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.
Let $f(x)=-1$ if $x$ is rational, and let $f(x)=1$ if $x$ is irrational.
Or else more modestly let $f(x)=-1$ if $x\lt 17$, and $f(x)=1$ for $x\ge 17$.