For example: the function f(x)=1/x has f(f(x))=x
There are also functions that when iterated thrice become the identity.
For example: The function f(x)=1/(1-x) has f(f(x))=(x-1)/x and f(f(f(x)))=f3(x)=x.
Are there functions for other values of n (or perhaps all values of n) where fn(x)=x but fm(x)≠x for any m<n?