Determine all functions $f: \mathbb{Z} \rightarrow \mathbb{Z}$ with the property that  $$ f(x-f(y))=f(f(x))-f(y)-1 $$  holds for all $x, y \in \mathbb{Z}$. (Croatia)
It is immediately checked that both functions mentioned in the answer are as desired. Now let $f$ denote any function satisfying (1) for all $x, y \in \mathbb{Z}$. Substituting $x=0$ and $y=f(0)$ into (1) we learn that the number $z=-f(f(0))$ satisfies $f(z)=-1$. So by plugging $y=z$ into (1) we deduce that 
$$ f(x+1)=f(f(x)) $$
holds for all $x \in \mathbb{Z}$. Thereby (1) simplifies to 
$$ f(x-f(y))=f(x+1)-f(y)-1 $$
We now work towards showing that $f$ is linear by contemplating the difference $f(x+1)-f(x)$ for any $x \in \mathbb{Z}$. By applying (3) with $y=x$ and (2) in this order, we obtain 
$$ f(x+1)-f(x)=f(x-f(x))+1=f(f(x-1-f(x)))+1 $$
Since (3) shows $f(x-1-f(x))=f(x)-f(x)-1=-1$, this simplifies to 
$$ f(x+1)=f(x)+A, $$
where $A=f(-1)+1$ is some absolute constant. Now a standard induction in both directions reveals that $f$ is indeed linear and that in fact we have $f(x)=A x+B$ for all $x \in \mathbb{Z}$, where $B=f(0)$. Substituting this into (2) we obtain that 
$$ A x+(A+B)=A^{2} x+(A B+B) $$
holds for all $x \in \mathbb{Z}$; applying this to $x=0$ and $x=1$ we infer $A+B=A B+B$ and $A^{2}=A$. The second equation leads to $A=0$ or $A=1$. In case $A=1$, the first equation gives $B=1$, meaning that $f$ has to be the successor function. If $A=0$, then $f$ is constant and (1) shows that its constant value has to be -1. Thereby the solution is complete. 

Comment. After (2) and (3) have been obtained, there are several other ways to combine them so as to obtain linearity properties of $f$. For instance, using (2) thrice in a row and then (3) with $x=f(y)$ one may deduce that 
$$ f(y+2)=f(f(y+1))=f(f(f(y)))=f(f(y)+1)=f(y)+f(0)+1 $$
holds for all $y \in \mathbb{Z}$. It follows that $f$ behaves linearly on the even numbers and on the odd numbers separately, and moreover that the slopes of these two linear functions coincide. From this point, one may complete the solution with some straightforward case analysis. 

A different approach using the equations (2) and (3) will be presented in Solution 2. To show that it is also possible to start in a completely different way, we will also present a third solution that avoids these equations entirely.