Ma · Mathematics

When Is the Absolute Value of a Function Continuous?

Published By the 9to5Science editorial team

At a glance

  1. 1. Use continuity of absolute value

    The map x ↦ |x| is continuous everywhere.

  2. 2. Compose the functions

    If f is continuous at a point, then |f| is continuous there.

  3. 3. Check the converse

    Continuity of |f| does not generally imply continuity of f.

  4. 4. Find the failure

    A function can jump between positive and negative values while its absolute value stays unchanged.

The absolute value of a real-valued function is continuous wherever the original function is continuous. This follows because taking an absolute value is itself a continuous operation.

However, the converse is false in general: a continuous absolute-value function does not guarantee that the original function is continuous. The issue is that absolute value removes sign information.

The basic theorem

Let f:D→Rf:D\to\mathbb{R} be a function, where DD is a subset of R\mathbb{R}. If ff is continuous at a∈Da\in D, then the function

g(x)=∣f(x)∣g(x)=|f(x)|

is continuous at aa.

There are two standard ways to see this.

First, the function u↦∣u∣u\mapsto |u| is continuous on R\mathbb{R}. Therefore gg is the composition of two continuous functions:

g=∣⋅∣∘f.g=|\cdot|\circ f.

Second, use the inequality

∣∣f(x)∣−∣f(a)∣∣≤∣f(x)−f(a)∣.\bigl||f(x)|-|f(a)|\bigr|\leq |f(x)-f(a)|.

If f(x)→f(a)f(x)\to f(a) as x→ax\to a, then the right-hand side tends to zero. Consequently,

∣f(x)∣→∣f(a)∣,|f(x)|\to |f(a)|,

which is exactly the continuity of ∣f∣|f| at aa.

Epsilon–delta proof

Suppose ff is continuous at aa. To prove that ∣f∣|f| is continuous at aa, let ε>0\varepsilon>0.

Since ff is continuous at aa, there exists δ>0\delta>0 such that

∣x−a∣<δ⟹∣f(x)−f(a)∣<ε.|x-a|<\delta \quad\Longrightarrow\quad |f(x)-f(a)|<\varepsilon.

The reverse triangle inequality gives

∣∣f(x)∣−∣f(a)∣∣≤∣f(x)−f(a)∣<ε.\bigl||f(x)|-|f(a)|\bigr|\leq |f(x)-f(a)|<\varepsilon.

Thus, whenever ∣x−a∣<δ|x-a|<\delta,

∣∣f(x)∣−∣f(a)∣∣<ε.\bigl||f(x)|-|f(a)|\bigr|<\varepsilon.

Therefore ∣f∣|f| is continuous at aa.

The same argument works when the domain is a metric space and the codomain is a normed vector space: if FF is continuous, then x↦∥F(x)∥x\mapsto \|F(x)\| is continuous.

Worked example

Take

f(x)=x2−3x+1.f(x)=x^2-3x+1.

Because ff is a polynomial, it is continuous on R\mathbb{R}. Therefore

g(x)=∣x2−3x+1∣g(x)=|x^2-3x+1|

is continuous on R\mathbb{R}.

The formula for gg can be written piecewise by finding the zeros of ff:

x2−3x+1=0x^2-3x+1=0

has roots

x=3−52andx=3+52.x=\frac{3-\sqrt{5}}{2}\quad\text{and}\quad x=\frac{3+\sqrt{5}}{2}.

Thus ff changes sign at those two points, but ∣f∣|f| remains continuous there. Explicitly,

∣f(x)∣={x2−3x+1,x≤3−52,−(x2−3x+1),3−52≤x≤3+52,x2−3x+1,x≥3+52.|f(x)|= \begin{cases} x^2-3x+1, & x\leq \frac{3-\sqrt{5}}{2},\\ -(x^2-3x+1), & \frac{3-\sqrt{5}}{2}\leq x\leq \frac{3+\sqrt{5}}{2},\\ x^2-3x+1, & x\geq \frac{3+\sqrt{5}}{2}. \end{cases}

Although the derivative may fail to exist at a zero where the sign changes, continuity is preserved. For example, ∣x∣|x| is continuous at 00 but is not differentiable there.

The converse is false

It is tempting to claim

∣f∣ continuous⟹f continuous,|f|\text{ continuous}\quad\Longrightarrow\quad f\text{ continuous},

but this is not true.

Define

f(x)={1,x≥0,−1,x<0.f(x)= \begin{cases} 1, & x\geq 0,\\ -1, & x<0. \end{cases}

The function ff is discontinuous at 00: its left-hand limit is −1-1, while its right-hand limit and value at 00 are 11.

But

∣f(x)∣=1|f(x)|=1

for every xx. Hence ∣f∣|f| is constant and therefore continuous everywhere.

The absolute value cannot detect this discontinuity because both 11 and −1-1 have the same absolute value.

When can the converse hold?

The converse does hold under additional sign information. Suppose ∣f∣|f| is continuous at aa and ff has a fixed sign in some neighborhood of aa.

If f(x)≥0f(x)\geq 0 near aa, then f(x)=∣f(x)∣f(x)=|f(x)| near aa, so ff is continuous at aa whenever ∣f∣|f| is.

If f(x)≤0f(x)\leq 0 near aa, then f(x)=−∣f(x)∣f(x)=-|f(x)| near aa, so again ff is continuous at aa.

The condition f(a)≠0f(a)\neq 0 by itself is not sufficient. For example, define

f(x)={1,x=0,−1,x≠0.f(x)= \begin{cases} 1, & x=0,\\ -1, & x\neq 0. \end{cases}

Then ∣f(x)∣=1|f(x)|=1 for every xx, so ∣f∣|f| is continuous everywhere, but ff is discontinuous at 00 even though f(0)≠0f(0)\neq 0.

Thus, what matters is a fixed-sign condition, or another hypothesis that rules out sign switching, rather than merely the fact that f(a)f(a) is nonzero. A sign change can occur without the function taking the value zero when no intermediate-value property is available.

Common mistakes

Confusing continuity and differentiability

If ff is continuous, then ∣f∣|f| is continuous. But ∣f∣|f| may not be differentiable where ff is zero and changes sign. The function f(x)=xf(x)=x gives ∣f(x)∣=∣x∣|f(x)|=|x|, which is continuous but not differentiable at zero.

Assuming absolute values preserve all information

The equality ∣f(x)∣=∣f(a)∣|f(x)|=|f(a)| does not imply f(x)=f(a)f(x)=f(a). The values could have opposite signs. This is why continuity of ∣f∣|f| alone cannot always establish continuity of ff.

Ignoring the domain

Continuity is considered relative to the domain. For example, if a function is defined only on [0,∞)[0,\infty), continuity at 00 uses points from the domain and does not require a two-sided limit from all real numbers.

Forgetting the reverse triangle inequality

The estimate

∣∣u∣−∣v∣∣≤∣u−v∣\bigl||u|-|v|\bigr|\leq |u-v|

is often the quickest proof. It says that the absolute-value operation is Lipschitz continuous with constant 11.

A useful generalization

The same reasoning applies to any continuous function ϕ:R→R\phi:\mathbb{R}\to\mathbb{R}. If ff is continuous, then ϕ∘f\phi\circ f is continuous. Taking ϕ(t)=∣t∣\phi(t)=|t| gives the result here.

More generally, if ff is continuous and pp is a positive integer, then x↦∣f(x)∣px\mapsto |f(x)|^p is continuous. For p=1p=1, this is the absolute-value result; for p=2p=2, it follows from ∣f(x)∣2=f(x)2|f(x)|^2=f(x)^2.

References

  1. Walter Rudin, Principles of Mathematical Analysis
  2. Tom M. Apostol, Mathematical Analysis

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.