Doubt: Find all strictly increasing functions $f : \Bbb {Z} \rightarrow \Bbb{Z}$ such that $f (f (x)) = x + 2$ for all integers $x$ . 
Find all strictly increasing functions $f : \Bbb {Z} \rightarrow \Bbb{Z}$ such that
$f (f (x)) = x + 2$ for all integers $x$ .


I completely understood till we get $f(x+1)=f(x)+1$ . But, I couldn't understand this line , "In other words, $f (x) = x + f (0)$ for all integers $x$." .
Thanks in advance!
 A: Given any $n$, we have
\begin{align*}
f(n) &= f(n-1) + 1\\
f(n-1) &= f(n-2) + 1\\
&\dots\\
f(1) &= f(0) + 1\\
\end{align*}
Adding everything up, we get $f(n) = f(0) + n$. Alternatively, you can use induction.
P.S. Care for negative $n$.
A: Here is how to find all not necessarily strictly increasing solutions. You have $f(x+2)=f(x)+2$. Consider $g(x)=f(x)-x$. Then $g(x+2)=g(x)$ for every integer $x$. That means, $g(x)$ is a constant, say, $c$ on the set of even numbers and a constant, say, $d$ on the set of odd numbers. Then take $x=0$, you get $f(f(0))=f(0+c)=c+d$ if $c$ is odd or $=2c$ if $c$ is even. But it should be $=x+2$, so if $c$ is even we have $2c=2$, $c=1$, a contradiction. So $c$ is odd and $c+d=2$, so $d$ is odd. Now take arbitrary odd $c, d$ with $c+d=2$ and define $f(x)=x+c$ for even $x$ and $f(x)=x+d$ for odd $x$. This $f$ satisfies your condition $f(f(x))=x+2$.
Now the only function among these which is strictly increasing is obtained when $c=d=1$. So the solution is $f(x)=x+1$.
