## Task A-4.2.

Determine all functions $f: \mathbb{N}_{0} \rightarrow \mathbb{N}_{0}$ such that for all $x \in \mathbb{N}_{0}, y \in \mathbb{N}$ the following holds:

$$
(f(x)+1)(f(y)+1)=(x+1)(f(y-1)+1)+f(x+1)
$$
## Solution.

By substituting $x=0, y=1$, we get

$$
(f(0)+1)(f(1)+1)=f(0)+1+f(1)
$$

from which it follows that $f(0) f(1)=0$. Therefore, we conclude that $f(0)=0$ or $f(1)=0$.

First, assume that $f(1)=0$. By substituting $x=y=1$, we get

$$
1=2(f(0)+1)+f(2)=2 f(0)+2+f(2) \geqslant 2
$$

where the last inequality holds because the function $f$ takes values in non-negative integers, i.e., $f(0), f(2) \geqslant 0$. This leads to a contradiction, so it follows that $f(0)=0$.

If we now substitute $x=0$, we get that for every natural $y$,

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

We will prove by induction that $f(n)=n f(1)$ for every $n \in \mathbb{N}_{0}$. The base case follows from $f(0)=0$. Assume that the statement $f(n)=n f(1)$ holds for some natural $n$. Then by substituting $y=n+1$ into the above equation, we get

$$
f(n+1)=f(n)+f(1)=n f(1)+f(1)=(n+1) f(1)
$$

which completes the induction proof.

Finally, substitute $x=y=1$ into the initial equation, and we get

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

from which it follows that $f(1)^{2}=1$, so $f(1)=1$ (since $f(1) \geqslant 0$).

Thus, the only candidate for the solution is the function $f(x)=x$. By verification, we confirm that this is indeed the solution.