## Task 1.

Determine all functions $f: \mathbb{R} \rightarrow \mathbb{R}$ such that for all real numbers $x, y$ the following holds

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

By substituting $x=y=0$ into the initial equation, we get $f(0)=-1$.

By substituting $x=0$ into the initial equation, we find that for all $y \in \mathbb{R}$,

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

If $f(1) \neq 0$, then the expression $y f(1)$ takes all real values, so $f(x)=-1$ for all $x \in \mathbb{R}$. Direct verification shows that the function $f(x)=-1$ is a solution. Let $f(1)=0$ from now on. Assume that for some $x \in \mathbb{R}$, $f(x+1) \neq x$. For such an $x$, take $y=\frac{x}{x-f(x+1)}$ (since for such a $y$, $x+y f(x+1)=x y$). By substituting such $x$ and $y$ into the initial equation, we get

$$
\begin{gathered}
f(x y)=f(x)+f(x y)+1 \\
f(x)=-1
\end{gathered}
$$

We conclude that for every $x \in \mathbb{R}$, $f(x+1)=x$ or $f(x)=-1$.

In particular, for $x=1$, since $f(1)=0$, it must be that $f(2)=1$. By substituting $x=1$ into the initial equation, we get $f(y+1)=f(y)+1$.

Assume that for some $x \neq 0$, $f(x)=-1$. From the conclusion $f(y+1)=f(y)+1$, it first follows that $f(x+1)=0$, and then $f(x+2)=1$. Since for $x+1$, $f(x+2)=x+1$ or $f(x+1)=-1$, we conclude that

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

from which $x=0$, leading to a contradiction.

Thus, for all $x \in \mathbb{R}$, $f(x+1)=x$ (including $x=0$, which we verified earlier), i.e., we get the solution $f(x)=x-1$ for all $x \in \mathbb{R}$. Direct verification shows that the function satisfies the conditions of the problem.

The sought functions are given by the rules $f(x)=-1$ and $f(x)=x-1$ for all $x \in \mathbb{R}$.