GeorgeRP wrote:
Find all functions $f: \mathbb{Z} \to \mathbb{Z}$ such that
\[
f(x) + f(y - 1) + f(f(y - f(x))) = 1
\]for all integers $x$ and $y$.
Let $P(x,y)$ be the assertion $f(x)+f(y-1)+f(f(y-f(x)))=1$
Let $a=1-f(f(1))$
$P(x,f(x)+1)$ $\implies$ $f(f(x))=a-f(x)$
And so $P(x,y+1)$ $\implies$ $f(x)+f(y)+a-f(y+1-f(x))=1$ and so
New assertion $Q(x,y)$ : $f(y+1-f(x))=f(y)+(a-1+f(x))$
Then, with immediate induction : $f(y+n(1-f(x)))=f(y)+n(a-1+f(x))$ $\forall n\in\mathbb Z$
Setting there $n=1-f(z)$, we get $f(y+(1-f(z))(1-f(x)))=f(y)+(1-f(z))(a-1+f(x))$
And so, swapping there $x,z$ and subtracting : $(1-f(z))(a-1+f(x))=(1-f(x))(a-1+f(z))$
And so $af(x)=af(z)$
If $a\ne 0$, this implies $f(x)$ constant, which is not a solution. And so $a=0$
So $f(f(1))=1$ and $f(f(x))=-f(x)$ $\forall x$
So $1=f(f(1))=-f(1)$ and $f(1)=-1$
And $Q(1,x)$ $\implies$ $f(x+2)=f(x)-2$
Since $f(1)=-1$, this implies $f(x)=-x$ $\forall x$ odd.
and $f(2n)=u-2n$ for some $u=f(0)$
If $u$ is even, $f(2n)$ is even and so $-f(2n)=f(f(2n))=u-f(2n)$ and so $u=0$
And solution $\boxed{\text{S1 : }f(x)=-x\quad\forall x\in\mathbb Z}$, which indeed fits
If $u=2k+1$ is odd, easy to check that any such $u$ fits
And solution $\boxed{\text{S2 : }f(2n+1)=-(2n+1)\text{ and }f(2n)=2k+1-2n\quad\forall n\in\mathbb Z}$, which indeed fits, whatever is $k\in\mathbb Z$