Prove or disprove that $f$ is an identity function if $f(f(f(x))) = x$ and $f$ is continuous Let $f$ be a continuous function in $\mathbb R$ satisfying the relation 
$f(f(f(x))) = x$, for all $x \in \mathbb R$. 
Prove or disprove that $f$ is an identity function. 
 A: Let $x$ such that $f(x) \neq x$. Let $y=f(x)$.
Suppose that $x<y$.
$f$ is bijective from $\mathbb{R}$ to $\mathbb R$ (since $f \circ f^2 = f^2 \circ f= \textrm{Id}_{\mathbb R}$) and then strictly monotone (by continuity). By composition $f$ is strictly increasing. Indeed, if $f$ is non increasing, then $x_1 < x_2 \implies f(x_1) > f(x_2) \implies f(f(x_1))<f(f(x_2) \implies f(f(f(x_1))) > f(f(f(x_2))) \implies x_1 > x_2$, which is absurd.
$x < y$ gives $f(x) < f(y)$ and then $f(f(x)) < f(f(y)) = f(f(f(x))) = x$.
But $f(x)=y$ which gives $f(y) < x < y = f(x)$. Then $f(y) < f(x)$ which is absurd because $f$ is supposed to be non decreasing.
We treat the case $y<x$ in the same way.
A: In this answer I'll discuss the conditions of application of the theorem.
You have to explicit the range of $f$, because $f:\mathbb R\mapsto\mathbb C,\ f(x)=jx$ 
with $j^3=1$ is continuous over $\mathbb R$ and verifies $f(f(f(x)))=j^3x=x\ $ and yet is not the identity function.
It's not completely clear in your statement that $f$ range is $\mathbb R$.
Note that continuity is essential here, for instance the function below verifies $f^3=Id$ :
$f(x)=\big(x+1\pmod 3\big)+3n\quad x\in[3n,3n+3[$
It is continuous almost everywhere, but the countable discontinuities at $3n+2$ allows for global non-monotonicity of the function $f$ even if it is locally increasing away from these points.
