Proving that if $f$ is continuous on an interval then $|f|$ is continuous on the interval too

82 Views Asked by At

I have to prove the following: Show that if $f : (a, b) →\mathbb R$ is continuous then $|f|$ is continuous on $(a, b)$ as well.

So I want to show that $lim_{x \rightarrow x_0} |f(x)| = |f(x_0)|$. It's easy to show this for $x_0$ s.t. $f(x_0) < 0$ or $f(x_0) > 0$ because we know, for example, that if $lim_{x \rightarrow x_0} f(x) = f(x_0) > 0$ then there must exist a $\delta$ s.t. $f(x) < 0$ $\forall |x-x_0|<\delta$ so we can say $lim_{x \rightarrow x_0} |f(x)| = lim_{x \rightarrow x_0} f(x) = f(x_0) = |f(x_0)|$. However I'm not sure how to show it for $x_0$ s.t. $f(x_0) = 0$. The way I tried to show it $x_0$ s.t. $f(x_0) = 0$ was by saying that if $f(x_0) = 0$ then $lim_{x \rightarrow x_0} f(x) = f(x_0) = 0 =|f(x_0)|$ so we must have $lim_{x \rightarrow x_0} |f(x)| = |f(x_0)|$. But this to me just seemed trivially true and I wasn't really sure if my justification was a justification at all.

2

There are 2 best solutions below

3
On

Hint: $\big||f(x)|-|f(x_0)|\big| \leq |f(x)-f(x_0)|$ by the reverse triangle inequality.

0
On

Not sure if you are allowed to use this in your answer, but note that $|f(x)|=g(f(x))$ where $g:\mathbb R\to \mathbb R$, $g(x)=|x|$. Thus, you can first prove that $g$ is continuous, and then invoke the theorem that the composition of two continuous functions is continuous.

Now, note that $g$ is continuous on $(-\infty,0]$ (where it coincides with $x\mapsto -x$) and on $[0,+\infty)$ (where it coincides with $x\mapsto x$), so it is continuous on the whole $\mathbb R$.