TITLE: If the absolute value of a function is continuous, is the function continuous?
QUESTION [13 upvotes]: If $|f(x)|$ is continuous at $a$, is $f(x)$ continuous at $a$?
I tried doing it using composite functions.
If $g(x)= |x|$, then $g\circ f(x)= |f(x)|$.
Since $g(x)$ and $g\circ f(x)$ are continuous, $f(x)$ is continuous.
I don't know if this is correct. Please help.

REPLY [2 votes]: Maybe you are misunderstanding the logic behind it:
Let $g(x)$ be continuous, OK.
Now, saying

$g \circ f(x)$ is continous if $f(x)$ is continuous

doesn't imply that

$g \circ f(x)$ is not continuous if $f(x)$ is not continuous

Also, it's never true to say that $g \circ f(x)$ is continuous because $f(x)$ is continuous.

The single (and obvious) conclusion that we can take is that if $f(x)$ is continuous, then $g \circ f(x)$ certainly is continuous too. But if $f(x)$ is discontinuous, then $g \circ f(x)$ may be, or may be not.
So you can deduce nothing about $f(x)$ from the behaviour of $g \circ f(x)$.