$\textbf{Solution (P4)}$FuadAlAlam wrote: ↑Tue Jun 01, 2021 11:16 pmProblem 4:
Find all functions $f : \mathbb{Z} \rightarrow \mathbb{Z}$ such that
$$f(x + y) + f(x)^2f(y) = f(y)^3 + f(x + y)f(x)^2$$
for all $x, y \in \mathbb{Z}$.
Here, the equation of the question is, $$f(x+y) + f(x)^2f(y) = f(y)^3+f(x+y)f(x)^2$$
Now, for $x=0,y=a$, we get,
$$f(a) + f(0)^2f(a) = f(a)^3+f(a)f(0)^2$$
$$\Rightarrow f(a) = f(a)^3$$
$$\Rightarrow f(a) \in \{-1,0,1\}\ \forall \ a \in \mathbb{Z}$$
Now there is two cases.
$\boxed{\textbf{Case 1:}\ f(a) \in \{-1,1\}\ \forall \ a \in \mathbb{Z}}$
$\underline{\text{Claim :}}$ No matter if $f(x)=1 \text{ or, } f(x) =-1$ this always satisfy the equation given in the question.
$\underline{\text{Proof :}}$ Here, it is trivial that, $f(x)^2= 1$ and $f(x)^3= f(x)$ $ \forall \ x \in \mathbb{Z}$
Therefore,
$$f(x+y) + f(x)^2f(y) = f(y)^3+f(x+y)f(x)^2$$
$$\Rightarrow f(x+y) + f(y) = f(y)+f(x+y)$$
And, that's always true.
So, for this case, the solution is, for any $x \in \mathbb{Z}$, $f(x)=1$ or $f(x)=-1$
$\boxed{\textbf{Case 2:}\ \text{There is } a\in \mathbb{Z}:f(a) = 0}$
Now there is two subcases.
$\boxed{\textbf{Subcase 1:} \ \text{only } a \text{ is } a=0}$
$\underline{\text{Claim :}}$ For $n\neq 0$,
no matter if $f(n)=1 \text{ or, } f(n) =-1$ this always satisfy the equation given in the question.
$\underline{\text{Proof :}}$ Here, it is trivial that, $f(x)^2= 1$ or $f(x)^2= 0$ and $f(x)^3= f(x)$ $ \forall \ x \in \mathbb{Z}$
For,$f(x)^2 = 1 $ we have already showed that, $$f(x+y) + f(x)^2f(y) = f(y)^3+f(x+y)f(x)^2$$
$$\Rightarrow f(x+y) + f(y) = f(y)+f(x+y)$$
Which is always true.
And for, $f(x)^2=0$, $$f(x+y) + f(x)^2f(y) = f(y)^3+f(x+y)f(x)^2$$
$$\Rightarrow f(x+y)=f(y)$$
$$\Rightarrow f(y) = f(y)$$
and this is also true.
So, for this subcasecase, the solution is, for any $x \in \mathbb{Z} \text{ and } x\neq 0$, $f(x)=1$ or $f(x)=-1$ and $f(0)=0$.
$\boxed{\textbf{Subcase 2:} \ \text{There exists } a \text{ such that } a\neq 0 ,f(a)=0}$
For this subcase lets take the integer $a_0:f(a_0) = 0$ and $|a_0|$ is smallest and positive.
Now for, $x=a_0,y= b$, $$f(b+a_0) = f(b)^3$$
$$\Rightarrow f(b+a_0) = f(b)$$
$$\Rightarrow f(b+d\cdot a_0) = f(b) \tag{1}$$
So, it is trivial that for any multiple $d\cdot a_0$ of $a_0$, $f(d\cdot a_0)=0$
$\underline{\text{Claim 1:}}$ There is no other $x:f(x)=0$.
$\underline{\text{Proof :}}$ For the sake of contradiction lets assume that there is a integer $a_1$ such that, $a_1$ is not divisible by $a_0$ and $f(a_1) = 0$
Again, for, $x=a_1,y= b$, $$f(b+d\cdot a_1) = f(b) \tag{2}$$
From equation $(1),(2)$ we get, $$f(x\cdot a_0+y\cdot a_1) =0 \ \forall \ x,y \in \mathbb{Z}$$
From bezout's identity we have, some $x_0,y_0:x_0\cdot a_0+y_0\cdot a_1 = gcd(a_0,a_1)$
So, $f(gcd(a_0,a_1))=0$
As, $|a_0| < |a_1|$ and $a_0$ dosent divide $a_1$, therefore, $$|gcd(a_0,a_1)|<|a_0|$$
That's a contradicts with the minimality of $|a_0|$
So the function is periodic and it repeat at interval of $a_0$
$\underline{\text{Claim 2:}}$ For each period of the function no matter if $f(x)=1 \text{ or, } f(x) =-1$ for $x:a_0\nmid x$ this always satisfy the equation given in the question
$\underline{\text{Proof :}}$ Here $f(x)^2 = 0 \text{ or }1$. For,$f(x)^2 = 1 $ we have already showed that, $$f(x+y) + f(x)^2f(y) = f(y)^3+f(x+y)f(x)^2$$
$$\Rightarrow f(x+y) + f(y) = f(y)+f(x+y)$$
Which is always true.
And for, $f(x)^2=0$, $$f(x+y) + f(x)^2f(y) = f(y)^3+f(x+y)f(x)^2$$
$$\Rightarrow f(x+y)=f(y)$$ and this is also true, as, $a_0\mid x$ and the function is periodic and it repeat at interval of $a_0$.
So the solution for this subcase is,
$f(d\cdot a_0) = 0$ for a $a_0\in \mathbb{N}$ and all $f(d\cdot a_0 + c) $ for each $c: a_0\nmid c$ are equal and equal to $+1$ or $-1$ $\blacksquare$