1
$\begingroup$

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?

  • 0
    You might want to work this out for yourself, so here is a hint: take a non-zero constant function for $|f(x)|$ (which is what I think you must mean, with $f$ mapping real line to real line). Then you need to think of a way of constructing $f(x)$ so that it is discontinuous - how could you make it discontinuous at a point? How could you use that on enough points to make it discontinuous everywhere?2011-10-24

1 Answers 1

18

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

  • 0
    Also known as $f=2\cdot\chi_{\Bbb Q}-1,$ for those familiar with [characteristic/indicator functions](http://en.wikipedia.org/wiki/Indicator_function).2013-12-17