Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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!

share|cite|improve this question
Hint: What happens if $f$ only takes the values $1$ and $-1$? – Tobias Kildetoft Jan 24 '13 at 19:50
@Tobias So you think the statement is false? I don't see the problem with a function defined like this: \begin{cases} 1 & x <0\\-1 & x \geq 0\end{cases} – tim_a Jan 24 '13 at 19:58
What I mean is that if $f$ only takes those two values, then $|f|$ is automatically continuous. But there are nowhere continuous functions with just those two values. – Tobias Kildetoft Jan 24 '13 at 20:02
Ok, I think I understand what you mean. But the statement is in the other direction. If you already know that $|f|$ is continuous, does this imply that $f$ is piecewise continuous in any case. – tim_a Jan 24 '13 at 20:07
No, what I mentioned gives you a way to construct a counter example. – Tobias Kildetoft Jan 24 '13 at 20:08
up vote 1 down vote accepted

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.

share|cite|improve this answer
Thank you for helping me! Do you know if there is a way of defining such a function with symbolic math software like Maple? – tim_a Jan 24 '13 at 20:21
You were starting light for the OP. – Babak S. Jan 24 '13 at 20:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.