TITLE: How to find $f$ if $f(f(x))=\frac{x+1}{x+2}$
QUESTION [32 upvotes]: let $f:\mathbb R\to \mathbb R$,and such

$$f(f(x))=\dfrac{x+1}{x+2}$$

Find the $f(x)$
My try

I found $f(x)=\dfrac{1}{x+1}$
  because when $f(x)=\dfrac{1}{x+1}$,then
  $$f(f(x))=f\left(\dfrac{1}{x+1}\right)=\dfrac{1}{\dfrac{1}{x+1}+1}=\dfrac{x+1}{x+2}$$
  so $f(x)=\dfrac{1}{x+1}$ such this condition,But $f(x)$  Have other form? Thank you

REPLY [6 votes]: This is not an answer, but it does not fit into the comment space
There's a link between the function $f(x)$ and the Fibonacci numbers which is quite interesting.
We know that
$$f(f(x)) = \frac{x+1}{x+2}$$
If we substitute $x$ with $f(f(x))$ again we get
$$f(f(f(f(x)))) = \frac{5x+8}{8x+13}$$
If we repeat this process again, we get 
$$f(f(f(f(f(f(x)))))) = \frac{13x+21}{21x+34}$$
If fact, if we apply the function $n$ times, where $n$ is even we obtain,
$$f(f(f(...f(x)...))) = \frac{F_{n-1}x+F_{n}}{F_{n}x+F_{n+1}}$$
where $F_n$ is the $n$th Fibonacci number

Notice that if we assume that the relation above holds for odd $n$ (i.e we apply $f(x)$ an odd number of times), and we compose this with itself (i.e we get $f(f(f(...f(x)...)))$  $2n$ times) we get exactly the value of $f(x)$ composed $2n$ times. This again, we can easily verify.
Since the relation above holds for odd $n$ we see that a possible function is
$$\frac{1}{x+1}$$
when we substitute $n=1$