# If f is a continuous real valued function and |f| is constant then show that f is constant.

If $f$ is a continuous real valued function and $|f|$ is constant, then show that $f$ is constant.

I tried using Intermediate Value Theorem for the same, but I'm unable to proceed.

Kindly help.

• Suppose $|f| = c > 0$. Now suppose there were $a, b$ such that $f(a) = c, f(b) = -c$. Can you derive a contradiction? Jan 11, 2015 at 13:12

## 2 Answers

If $|f|=0$ then $f=0$ is constant.

If $|f|=c>0$ then $f$ does not take the value $0$. Since a continuous function taking both positive and negative values also takes the value $0$ by the intermediate value theorem, this means that $f$ either is positive everywhere or negative everywhere. In the first case, we find $f=c$, in the second case we find $f=-c$. In conclusion, $f$ is constant.

$\exists c \in \mathbb{R} \text{ s.t. } \forall x \in \mathbb{R}, \left|f(x)\right|=c$

$$\implies \forall x \in \mathbb{R}, f(x) = c \text{ or } - c$$

If $c=0$ then $f$ constant-valuated. Else suppose that $f$ is not constant. Then :

$$\exists x_0 \in \mathbb{R} \text{ s.t. } \lim\limits_{x_0^-}f \neq \lim\limits_{x_0^+}f$$

Which contradicts continuity.

OR

Using the intermediate value theorem (even just Cauchy theorem), you can say that that if $f$ isn't constant then : $$\exists(x_0,x_1)\in\mathbb{R}^2 \text{ s.t. } f(x_o) = c \text{ and } f(x_1) = -c$$ The intermediate value theorem then allows you to state that : $$\exists{x_c}\in]\min{(x_0,x_1), \max{(x_0,x_1)}[} \text { s.t. } f(x_c)=0$$ And then $\left|f(x_c)\right| = 0 \neq c$ which contradicts the hypothesis.