Absolute function continuous implies function piecewise continuous?

1.2k Views Asked by At

I have a simple true/false question that I am not sure on how to prove it.

If $|f(x)|$ is continuous in $]a,b[$ then $f(x)$ is piecewise continuous in $]a,b[$

Anyone that can point me in the right direction or give a counterexample, even though I think it's true. Thanks in advance!

1

There are 1 best solutions below

2
On BEST ANSWER

Here is a counter example to the statement:

Define $f(x)$ to be $1$ if $x$ is rational and $-1$ if $x$ is irrational. Now $f$ is not continuous anywhere, but $|f|$ is identically $1$ and thus continuous.