[Math] Find all continuous functions $f(x)^2=x^2$

analysiscalculuscontinuityreal-analysis

Find all functions $f$ which are continuous on $\mathbb R$ and which satisfy the equation $f(x)^2=x^2$ for all $x \in \mathbb R$.

Clearly $f(x)=x, -x, |x|, -|x|$ all satisfy the condition. However, how can I show that these must be the only possible choices? The condition guarantees that $|f(x)|=|x|$, for all $x$ so I think it's quite obvious that these four choices are the only possibilities. But I don't see why continuity is necessary. If $f$ does not need to be continuous, are there other possibilities? Then how can I use continuity to guarantee that these are the only choices?

Best Answer

From $f(x)^2 = x^2$ follows "only" that $f(x) = x$ or $f(x) = -x$ for each $x \in \mathbb R$. Without the continuity requirement, you could choose from both possibilities for each $x$ independently. For example, $f(x)=x$ if $x$ is rational and $f(x)=−x$ if $x$ is irrational.

So what you need to show is that either $$ f(x) = x \text{ for all } x > 0 $$ or $$ f(x) = -x \text{ for all } x > 0 \, . $$ and this follows from the continuity: If there were $x_1, x_2 > 0$ such that $f(x_1) = x_1 > 0$ and $f(x_2) = -x_2 < 0$ then because of the Intermediate Value Theorem there would be a $x_3 > 0$ such that $f(x_3) = 0$, contradicting the requirement $f(x_3)^2 = x_3^2$.

For the same reason you have either $$ f(x) = x \text{ for all } x < 0 $$ or $$ f(x) = -x \text{ for all } x < 0 \, . $$

This gives the four possible functions $f(x)=x, -x, |x|, -|x|$.

Related Question