$\begingroup$

I would like to find the set of continuous functions $f_n(x)$, where $f_n(x):\mathbb{R}\to \mathbb{R}$ satisfies $$f_n(f_n(f_n(f_n...(x)))) = x$$ where there are $n$ iterations of $f(x)$. For example $f_1(x)$ would be the solution to $f_1(x)=x$. $f_2(x)$ would be the solution to $f_2(f_2(x)) = x$.

For $f_1(x)$, the only solution is $f_1(x)=x$. For $f_2(x)$, the solutions are involutions.

For $f_3(x)$, the only answer is $f_3(x)=x$. For all other $f_n(x)$, one solution is $f_n(x) = x$.

My question: For $n \ge 3$, is $f_n(x) = x$ the only solution? If not, what are the solutions?

Edit: @MattSamuel said that any involution works for an even $n$. This is because $f_n(f_n(x))$ can be replaced with $x$. For example, $$f_2(f_2(f_2(f_2(f_2(f_2(x)))))) = f_2(f_2(f_2(f_2(x)))) = f_2(f_2(x)) = x$$ However, this does not necessarily mean that involutions are the only set of solutions for $f_{2k}(x)$.