Let $f:\mathbb{N}\to\mathbb{N}$ such that $f(f(n))=n+2$.
In the post Find all strictly increasing functions on positive integers such that $f(f(n))=n+2$ there is an hypothesis about $f$: if $f$ is increasing, then the only solution is $f(n)=n+1$.
But what happen if $f$ is not increasing? Are there another solutions to functional eqution?
This will do it: $$f(n)=\cases{n+3&if $n$ is odd\cr n-1&if $n$ is even.\cr}$$ I am assuming you take $\Bbb N$ to exclude $0$ as in the linked question, which specified $\Bbb N^+$. But if you want to include $0$ you can create a very similar example.