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?

  • 2
    you should either put $|x|\to |f|$ or take any discontinuous $f$ as an answer2011-10-24
  • 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
    Could you explain how?2011-10-24
  • 1
    I assume you meant that $x\mapsto|f(x)|$ should be continuous everywhere. That is true here because $|f(x)|=1$ for all $x$. Did you mean something else by "$|x|$ is continuous everywhere"?2011-10-24
  • 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