1. Let $\mathbb{Z}$ denote the set of integers. Find all functions $f: \mathbb{Z} \rightarrow \mathbb{Z}$ such that for all integers $m$ and $n$:

$$
f(m+n) + f(m) f(n) = n^2 (f(m) + 1) + m^2 (f(n) + 1) + mn (2 - mn)
$$

# Solutions
Solution 1 Let $\mathbf{E}(m, n)$ denote the equation from the statement. The equation $\mathbf{E}(0,0)$ indicates that $f(0)=0$ or $f(0)=-1$. If $f(0)=0$, the equation $\mathbf{E}(0, n)$ indicates that $f(n)=n^{2}$ for all $n \in \mathbb{Z}$. We now assume that $f(0)=-1$.

The equation $\mathbf{E}(-n, n)$ now indicates that

$$
-1+f(n) f(-n)=n^{2}\left(f(n)+f(-n)-n^{2}\right)
$$

which we factorize as

$$
\left(f(n)-n^{2}\right)\left(f(-n)-n^{2}\right)=1
$$

Since $f(n)-n^{2}$ and $f(-n)-n^{2}$ are integers, this means that the integer $g(n)=f(n)-n^{2}=$ $f(-n)-n^{2}$ is equal to $\pm 1$.

The equation $\mathbf{E}(m, n)$ can then be rewritten as

$$
g(m+n)+g(m) g(n)=0
$$

which means that the function $-g$ is multiplicative. The two possible functions $g$ are therefore $g: n \mapsto-1$ and $g: n \mapsto(-1)^{n+1}$. Moreover, the function $n \mapsto 0$ is also multiplicative.

In conclusion, the three solution functions are

$$
f: n \mapsto n^{2}, f: n \mapsto n^{2}-1 \text { and } f: n \mapsto n^{2}+(-1)^{n+1}
$$