Functions $f(x)$ with the property $f^2(x)=x$ are called involutory. I've been calling functions with the property $f^n(x)=x$ n-involutory. I've found a couple different functions of the form $$f(x)=\frac{ax+b}{cx+d}$$ that are 2-involutory, 3-involutory, and 4-involutory, and even 6-involutory, but none that are 5-involutory. Can anybody find one?
Also, can anyone find an n-involutory function with $n \gt 2$ that is not in that form (is not a rational function)?
Thanks! Everything I know so far can be found here.
Here's a real rational function $f$ such that $f^5=\mathrm{id}$. Let $\zeta=2\pi/5$ and let $$f(x)=\frac{x\cos\zeta-\sin\zeta}{x\sin\zeta+\cos\zeta}.$$ In other words, it is the fractional linear transformation given by the standard $2\times2$ rotation matrix performing one-fifth of a full revolution. Your link explains how this correspondence between rational functions and matrices works.
(Note that $f$ has a pole, so it isn't really a function $\mathbb R\to\mathbb R$. You can think of it as a function on the real projective line instead. The same is true of most of the functions in your link, so I assume you don't mind!)
As for non-rational functions, as Foobaz John suggests, you can do pretty much anything. For example, consider the function $g:\mathbb R\to\mathbb R$ given by $g:1\mapsto2\mapsto3\mapsto4\mapsto5\mapsto6\mapsto7\mapsto1$ and $g(x)=x$ for all other numbers. In other words, $g$ permutes seven chosen numbers and does nothing else. Then $g$ is $7$-involutory.