## Task A-4.2.

Determine all functions $f: \mathbb{Z} \rightarrow \mathbb{Z}$ that satisfy the following two conditions:
i) $f(n) f(-n)=f\left(n^{2}\right)$ for all $n \in \mathbb{Z}$,

ii) $f(m+n)=f(m)+f(n)+2 m n$ for all $m, n \in \mathbb{Z}$.
## First Solution.

From the second condition, substituting $m=n=0$ we get $f(0)=2 f(0)$, from which it follows that $f(0)=0$.

Substituting $m=1$ and $n=-1$ and using $f(0)=0$, from the second condition we get

$$
f(1)+f(-1)=2
$$

From the second condition, substituting $n=1$ we get $f(m+1)=f(m)+f(1)+2 m$, and by summing these equalities for $m=1, \ldots, k-1$ we get

$$
f(k)=k f(1)+2(1+2+\ldots+k-1)
$$

or

$$
f(k)=k f(1)+k^{2}-k
$$

Similarly, for $k \in \mathbb{N}$, we also get

$$
f(-k)=k f(1)+k^{2}-k
$$

Now, from the first condition, substituting $n=1$ we get $f(1) f(-1)=f(1)$, from which it follows that

$$
f(-1)=1 \quad \text { or } \quad f(1)=0
$$

We distinguish two cases.

Case I. $\quad f(-1)=1$.

From (1) it follows that $f(1)=1$, and then from (2) and (3), and considering $f(0)=0$, we get $f(n)=n^{2}$. Case II. $\quad f(1)=0$.

From (1) it follows that $f(-1)=2$, and then from (2) and (3) we conclude

$$
\begin{gathered}
f(n)=n^{2}-n, n \in \mathbb{N} \\
f(-n)=n^{2}+n, n \in \mathbb{N}
\end{gathered}
$$

and $f(0)=0$. More simply, $f(n)=n^{2}-n$ for all $n \in \mathbb{Z}$.

Thus, we have obtained two possible solutions. However, it is necessary to verify that the obtained functions $f(n)=n^{2}$ and $f(n)=n^{2}-n$ satisfy the conditions of the problem, i.e., that the identities

$$
\begin{gathered}
(m+n)^{2}=m^{2}+n^{2}+2 m n \\
(m+n)^{2}-(m+n)=m^{2}-m+n^{2}-n+2 m n
\end{gathered}
$$

hold.