TITLE: Find all real and continuous functions that are a 3-involution.
QUESTION [5 upvotes]: Find all continuous functions $f: \mathbb R \rightarrow \mathbb R$such that $f(f(f(x)))=x$. 
Obviously one solution to this functional equation is $f(x)=x$.
If the function is NOT continuous, there are also other solutions such as $f(x)=\frac{1}{1-x}$, but I'm not sure how to find all solutions that are continuous.

REPLY [3 votes]: Observe that $f$ must be injective. Now, since $f$ is continuous and injective on the interval $\mathbb{R}$, we conclude that $f$ is monotone. Now the variations of $f\circ f\circ f$ are that of $f$, and we conclude that $f$ must be increasing.
Now, let $x\in\mathbb{R}$. There are three cases:

$f(x)<x$,
$f(x)>x$,
$f(x)=x$.

We'll show that cases 1. and 2. are impossible:

Assume that $f(x)<x$. Then, since $f$ is increasing,
$f(f(x))<f(x)$, and applying $f$ again yields $x=f(f(f(x)))<f(f(x))$ from which we conclude that $x<x$, which is impossible.
Similarly, assume that $f(x)>x$. Then, $f(f(x))>f(x)$ and $x=f(f(f(x)))>f(f(x))$ from which we conclude that $x>x$, which is impossible.
Hence we must have $f(x)=x$.


This proof easily generalizes to the case of a continuous function $f:\mathbb{R}\longrightarrow\mathbb{R}$ such that
$$\forall x\in\mathbb{R},\ f^{[2p+1]}(x)=x,$$
where $p\in\mathbb{N}$ and $f^{[2p+1]}$ stands for the $(2p+1)$-th iterate of $f$.