Identity from repeated function composition Do functions exist such that $f^n(x)=x$ for values $n > 2$?
For $n=2$ we have $-x$ and $1/x$,
and for $n=3$ we can show $1/(1-x)$ is a solution.
I assume that $n$ must be prime and preferably solutions are differentiable over some interval.
Thanks
 A: If $\omega$ is an n-th root of unity then $f(x)=\omega x$ satisfies $f^{n} (x)=x$. 
A: Function defined by 
$$f(x)=\dfrac{x \cos(a) - \sin(a)}{x \sin(a) + \cos(a)} \ \ \text{with} \ \ a=\frac{2 \pi}{n} \tag{1}$$
called an "homographic function" (or "fractional linear function") is such that 
$$f^n(x)=x\tag{2}$$
Proof : 
1)  Coefficients used in (1) are exactly the entries of the rotation matrix $R_a$ with angle $a$.
2) The correspondence between functions 
$$f(x)=\dfrac{x p + q}{x r + s} \leftrightarrow \binom{p \ \ q}{r \ \ s} \tag{3}$$
(see https://users.math.msu.edu/users/sen/math_840_2005/lectures/lec_11s.pdf where it is presented for complex values of the variable) is a "nice" homomorphism putting compositions of such "homographies" in correspondence with products of their associated matrices. 
Thus (2) is equivalent to $R_a^n=Id$.
For example $y=f(x):\frac{1}{x}=\frac{0x+1}{1x+0}$ corresponds to the case $a=\pi$ in (1).
Remark : Correspondence (3) can be turned into an isomorphism if entries $a,b,c,d$ are considered "up to a factor" (we define in this way the "projective linear group" $PGL(2,\mathbb{R}). Another approach would be to constraint entries $a,b,c,d$ to be such that $\det(\binom{p \ \ q}{r \ \ s})=1$. 
