Suppose a function $f : \mathbb{R}\rightarrow \mathbb{R}$ satisfies $f(f(f(x)))=x$ for all $x$ belonging to $\mathbb{R}$.
(b) Suppose that $f$ is strictly decreasing, then $0 < 1 \Rightarrow f(0) > f(1) \Rightarrow f(f(0)) < f(f(1)) \Rightarrow f(f(f(0))) = 0 > 1 = f(f(f(1)))$. Contradiction.
(c) Suppose that $f$ is strictly increasing. Let $x \in \mathbb{R}$.
Suppose $f(x) > x$. Then $f(f(x)) > f(x) \Rightarrow f(f(f(x))) > f(f(x)) \Rightarrow x > f(f(x)) > f(x)$. This is absurd.
You can prove in the exact same way that $f(x) < x$ is absurd. Therefore $f(x) = x$.