This is an AoPS thread post.
$\blacksquare~$ Problem: Let $f:[0,1] \rightarrow[0,1]$ be a continuous function such that $f^{(n)}:=f \circ f \circ \cdots \circ f ~(n \text { times) and assume that there exists a positive integer } m$ such that $f^{(m)}(x)=x$ for all $x \in[0,1] .$ Prove that $f(x)=x$ for all $x \in[0,1]$
$\blacksquare~$ My Approach:
A small claim at first. The problem is not true for $m$ even.
$\bullet~$ Counter Example: Just as described in the post, take the function $f(x) = 1 - x~$ for all $x \in [0, 1].$ Then we have that $$ f^2(x) = x \quad \text{for }x \in [0, 1] $$ Therefore we can conclude that for $m = 2k$ [for some $k \in \mathbb{Z}]$ the statement of the problem can't be true (of course if the statement is changed to $\color{red}{\text{some}}$ instead of $\color{blue}{\text{for all}}$, then it's trivially true as by IVT, there exists $c \in [0, 1]$ such that $f(c) = c$).
Then $m $ must be odd.
$\bullet~$ Solution (when $m$ is odd):
Let $m = (2k + 1)$ . then If $m$ is odd, let $m = (2k + 1)$. Now, we have a claim.
$\bullet \bullet~ \textbf{Claim:}$ The map $f$ $\in$ $\mathscr{C}^{0}[0, 1]$ is monotonic.(this is independent of the parity of $m$).
$\bullet \bullet~ \textit{Proof:}$ Consider $x, y$ $\in$ $[0, 1]$ such that \begin{align*} &f(x) = f(y)\\ \implies &f^{m}(x) = f^{m}(y)\quad [\text{taking } f \circ f \circ \cdots \circ f]\\ \implies & x = y \quad [\text{as } f^{m}(x) = x ~ \text{for any } x \in [0, 1] ] \end{align*}Hence $f$ is one-one + $f$ $\in$ $~\mathscr{C}^{0}$ $\implies$ $f$ is monotonic in $[0, 1]$.
$\bullet~$ Then consider the function $g$ $\in$ $\mathscr{C}^{0}$ such that it's defined as$$ g(x) := f(x) - x \quad \text{for any } x \in [0, 1] $$By IVT, we have that for some $c$ $\in$ $[0, 1]$ $g(c) = 0 \implies f(c) = c$.
$\bullet~$ Now WLOG let's consider $f$ is decreasing. Therefore $$ f(x) < x \quad \text{for any } x \in (c, 1] \quad \text{and }~ f(x) > x \quad \text{for any } x \in [0, c) $$Then we have that \begin{align*} \implies&f^2(x) > f(x) \quad \text{for any } x \in (c, 1] \quad \text{and }~ f^2(x) < f(x) \quad \text{for any } x \in [0, c) \\ &~~~~~~~~~~ \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \vdots\\ \implies& f^{2k} (x) > f^{2k - 1}(x) \quad \text{for any } x \in (c, 1] \quad \text{and }~ f^{2k}(x) < f^{2k - 1}(x) \quad \text{for any } x \in [0, c) \\ \implies & x < f^{2k}(x) \quad \text{for any } x \in (c, 1] \quad \text{and }~ x > f^{2k}(x) \quad \text{for any } x \in [0, c) \\ \implies & f(x) > x \quad \text{for any } x \in (c, 1] \quad \text{and }~ f(x) < x \quad \text{for any } x \in [0, c) \end{align*}Which is a clear contradiction. Hence, we have that $$ f(x) = x \quad \text{for any } x \in (c, 1] \quad \text{and }~ f(x) = x \quad \text{for any } x \in [0, c) $$And as $f(c) = c$, therefore we have that $f(x) = x \quad \text{for any } x$ $\in$ $[0, 1]$.
$\bullet~$ $\textbf{If } f \textbf{ was increasing:}$ Then we would have had $$ f(x) > x \quad \text{for any } x \in (c, 1] \quad \text{and }~ f(x) < x \quad \text{for any } x \in [0, c) $$And again by the same procedure we can boil it down!
Can someone suggest another proof? And please verify this one for glitches.