Just for curiosity I was trying to find a sequence of non-trivial continuous functions at $\mathbb{R}$ except finite many points such that $f_{n+1}(f_{n+1}(x))=f_{n}(x)$, $f_1(x)=x$ and by non trivial I mean that $f_n (x)\ne x , \ f_n(x) \ne \frac{1}{x}, \ f(x)\ne -x$.
Let $f_2(x)= \frac{1-x}{1+x}$ I tried to find $f_3(x)$ but bit was too hard for me to find so I am not sure if a closed form of $f_n$ exist and I don't think there is a unique solution if the closed form exits.
Note that $f_{n+1}\ne -f_n$ ,$f_{n+1}\ne -\frac{1}{f_n} , \ f_{n+1}\ne f_n$ these are the trivial cases.
Is there a closed form for $f_n$? As I said before I think there might be infinite many non trivial solutions but if that the case I want any solution.