If $f^3=\rm id$ then it is identity function Let $f:\mathbb{R}\to \mathbb{R}$ be a continuous function such that $f^3(x)=f\circ f\circ f(x)=x$ for all $x$.
How can I prove $f$ is the identity function?
 A: First, if $x,y \in \mathbb{R}$ with $f(x) = f(y)$ then $x = f(f(f(x))) = f(f(f(y))) = y$ so $f$ is injective thus everywhere monotone, either increasing or decreasing. 
This latter fact relies on continuity: given $x,x',x'' \in \mathbb{R}$ with $x'' > x' > x$ and $f(x) >f(x'') >  f(x')$, say (so that it is not everywhere decreasing somewhere) in the decreasing case, then by intermediate value theorem there would be an $a \in [x,x']$ such that $f(a) = f(x'')$, an obvious contradiction. Then look at the set $\{x,f(x),f(f(x))\}$.  If $f$ is increasing, $x \leq f(x) \leq f(f(x))$, and if $f$ is decreasing, $x \geq f(x) \geq f(f(x))$.  In either case, the argument is the same: because $f$ is increasing in the first case, say, we have necessarily by applying $f$ to each part of the inequality, $f(x) \leq f(f(x)) \leq f(f(f(x))) = x \leq f(x)$.  This is only possible if $f(x) = x$ (the same trick works when $f$ is decreasing).  Since $x$ was arbitrary, you're done.
A: First show that $f^{-1}$ is strictly increasing. The comments above give hints how to show this. (You note that $f^{-1}=f^2$, hence $f$ is strictly monotone by continuity, hence $f^{-1}$ is strictly increasing). Since $f^{-1}$ is strictly increasing it follows that $f$ is strictly increasing.  
Now assume that $f(x)>x$ some $x \in \mathbb{R}$, then $f^2(x)>f(x)$, implying that $f^3(x)>f^2(x)$, hence $f^3(x)>f^2(x)>f(x)>x$. A contradiction.
