# If $f\circ f\circ f=id$, then $f=id$ [duplicate]

Let $f$ a continuous function on all $\mathbb R$. How can I prove that if $f\circ f\circ f=id$, then $f=id$ ? I really have no idea.

• @Wouter Well, if the domain is $\Bbb R$ and we speak of $f\circ f$ then the codomain better be $\Bbb R$ as well. May 9, 2016 at 8:20
• May 9, 2016 at 8:23
• The key is to notice that $f$ must be strictly monotonic increasing. May 9, 2016 at 8:24

By studying the domain, you have $f : \mathbb{R} \rightarrow \mathbb{R}$.
$\forall x \in \mathbb{R}$ the image by $f$ of $f(f(x))$ is $x$ so $f$ is onto. Also if $f(a)=f(b)$, then $a=f(f(f(a)))=f(f(f(b)))=b$, so $f$ is injective. So $f$ is one to one. If $f$ is decreasing $f\circ f$ is increasing and $f\circ f\circ f$ is decrasing, but $id$ is increasing, it is absurd, so $f$ is strictly increasing.
Suppose $f(x)>x$, since $f$ is strictly increasing $f(f(x))>f(x)>x$, so $x=f(f(f(x))>f(f(x))>f(x)>x$, it is impossible. In the same way $f(x)<x$ is impossible, so $\forall x, f(x)=x$. So $f=id$.
• "If $f$ is decreasing $f \circ f$ is decreasing.." No. Take for example $f(x)=\frac1x$. May 9, 2016 at 8:33