Let $\phi=\frac{1+\sqrt{5}}{2}$, so that we have the identities $\phi+1=\phi^2$ and $\phi-1=\frac{1}{\phi}$. Then $f(n)=\lfloor\phi n\rfloor$.
We prove this by strong induction. The base case is given. So suppose $f(n)=\lfloor\phi n\rfloor$ for all $n\leq k$, so that $f(f(k)-k+1)=f(\lfloor\phi k\rfloor -k+1)=\lfloor\phi(\lfloor\phi k\rfloor-k+1)\rfloor$. It is easy to prove that this value is either $k$ or $k+1$.
To establish the inductive hypothesis, if $f(f(k)-k+1)=k$ (so that $f(k+1)=\lfloor\phi k\rfloor+2$) then
$k<\phi(\lfloor\phi k\rfloor-k+1)<k+1$
$k+\phi k-\phi<\phi\lfloor\phi k\rfloor<k+1+\phi k-\phi$
$\phi^2k -\phi<\phi\lfloor\phi k\rfloor<\phi^2 k-\frac{1}{\phi}$
Dividing by $\phi$ and adding 2,
$\phi k+1<\lfloor\phi k\rfloor+2<\phi k+2-\frac{1}{\phi^2}$
$\phi(k+1)-(\phi-1)<f(k+1)<\phi (k+1)-(\phi-1)+(1-\frac{1}{\phi^2})$
$\phi(k+1)-\frac{1}{\phi}<f(k+1)<\phi (k+1)$
$f(k+1)=\lfloor\phi(k+1)\rfloor$
Similarly if $f(f(k)-k+1)=k+1$, so that $f(k+1)=\lfloor\phi k\rfloor+1$, then we can deduce that $\phi(k+1)-1<f(k+1)<\phi (k+1)-\frac{1}{\phi^2}$, so again $f(k+1)=\lfloor\phi(k+1)\rfloor$.