Task 3. Find all functions $f: \mathbb{R} \rightarrow \mathbb{R}$ such that

$$
f(x+y f(x+y))=y^{2}+f(x) f(y)
$$

for all $x, y \in \mathbb{R}$.
Solution II. Just like in the first solution, we deduce that $f(0)=1$ and that $f(1)=0$ or $f(-1)=0$.

First, assume that $f(1)=0$. Substituting $x=t-1$ and $y=1$ gives $f(t-1+f(t))=1$. On the other hand, $f(0)=1$ also holds. We now show that $f(z)=1$ implies that $z=0$. Assume $f(z)=1$. Substituting $x=1$ and $y=z-1$ gives $f(1+(z-1) f(z))=(z-1)^{2}$, so $f(z)=(z-1)^{2}$, or $1=(z-1)^{2}$. Thus, $z=0$ or $z=2$. Assume $z=2$, then substituting $x=0$ and $y=2$ gives $f(2 f(2))=4+f(0) f(2)$, which with $f(2)=f(z)=1$ leads to $f(2)=5$, contradicting $f(2)=1$. Therefore, $z=0$. In particular, from $f(t-1+f(t))=1$ it follows that $t-1+f(t)=0$, so $f(t)=1-t$. This function satisfies (see the first solution).

Now, assume that $f(-1)=0$. Substituting $x=t+1$ and $y=-1$ gives $f(t+1-f(t))=1$. On the other hand, $f(0)=1$ also holds. We again show that $f(z)=1$ implies that $z=0$. Assume $f(z)=1$. Substituting $x=-1$ and $y=z+1$ gives $f(-1+(z+1) f(z))=(z+1)^{2}$, so $f(z)=(z+1)^{2}$, or $1=(z+1)^{2}$. Thus, $z=0$ or $z=-2$. Assume $z=-2$, then substituting $x=0$ and $y=-2$ gives $f(-2 f(-2))=4+f(0) f(-2)$, which with $f(-2)=f(z)=1$ leads to $f(-2)=5$, contradicting $f(-2)=1$. Therefore, $z=0$. In particular, from $f(t+1-f(t))=1$ it follows that $t+1-f(t)=0$, so $f(t)=t+1$. This function also satisfies (see the first solution).