## Task 1.

Determine all functions $f: \mathbb{Z} \rightarrow \mathbb{Z}$ such that for all $x, y \in \mathbb{Z}$,

$$
f(x y + f(y)) = f(x) f(y) + y
$$
## First Solution.

Substitute $y=0$ into the initial expression and we get that for every $x \in \mathbb{Z}$,

$$
f(f(0))=f(x) f(0)
$$

If $f(0) \neq 0$, this means that $f(x)=\frac{f(f(0))}{f(0)}$ for every $x \in \mathbb{Z}$. But then the left side of the initial expression for all $x, y \in \mathbb{Z}$ is equal to $\frac{f(f(0))}{f(0)}$, and the right side is $\frac{f(f(0))^{2}}{f(0)^{2}}+y$. Since it is impossible for $\frac{f(f(0))}{f(0)}=\frac{f(f(0))^{2}}{f(0)^{2}}+y$ to hold for every $y \in \mathbb{Z}$, we conclude that $f(0)=0$. Now substitute $y=1$ into the initial expression. We get that for every $x \in \mathbb{Z}$,

$$
f(x+f(1))=f(x) f(1)+1
$$

In particular, for $x=-f(1)$, using $f(0)=0$, we get $0=f(-f(1)) f(1)+1$, or

$$
f(-f(1)) f(1)=-1
$$

Since $f(1)$ and $f(-f(1))$ are integers, we conclude that $f(1)=1$ or $f(1)=-1$.

If $f(1)=1$, then from (1) we get that for every $x \in \mathbb{Z}$, $f(x+1)=f(x)+1$. It follows that if $f(x)=x$, then $f(x+1)=x+1$ and $f(x-1)=x-1$, and since $f(0)=0$, by mathematical induction we conclude that $f(x)=x$ for every $x \in \mathbb{Z}$. It is easy to verify that this function satisfies the initial condition.

If $f(1)=-1$, then $f(-f(1))=1$. However, using $f(1)=-1$, we get $f(-f(1))=f(-(-1))=f(1)=-1$, which is a contradiction.