Which function ($f$) is continuous nowhere but $|f(x)|$ is continuous everywhere?

3.7k Views Asked by At

Which function ($f$) is continuous nowhere but $|f(x)|$ is continuous everywhere?

I found this question here, the question seems much interesting but for obvious reason it is closed there, I was wondering how to derive such a function?

1

There are 1 best solutions below

3
On BEST ANSWER

You could take $$f(x)=\begin{cases}1&x\in \mathbb Q \\ -1&x\in\mathbb R\setminus\mathbb Q\end{cases}$$