Prove that there exist infinitely many natural numbers $n$, for which there $\exists \, f:\{0,1…n-1\}\rightarrow \{0,1…n-1\}$, satisfying the following conditions: 1) $f(x)\neq x$; 2) $f(f(x))=x$; 3) $f(f(f(x+1)+1)+1)=x$ for $\forall x\in \{0,1…n-1\}$.
Problem
Source: VII International Festival of Young Mathematicians Sozopol 2016, Theme for 10-12 grade
Tags: function, special condition, algebra