Find all functions \( f: \mathbb{R} \rightarrow \mathbb{R} \) satisfying

\[
f\left(x+y f\left(x^{2}\right)\right)=f(x)+x f(x y)
\]

for all real numbers \( x \) and \( y \).
Let $P(x, y)$ be the assertion $f\left(x+y f\left(x^{2}\right)\right)=f(x)+x f(x y)$. $P(1,0)$ yields $f(0)=0$. If there exists $x_{0} \neq 0$ satisfying $f\left(x_{0}^{2}\right)=0$, then considering $P\left(x_{0}, y\right)$, we get $f\left(x_{0} y\right)=0$ for all $y \in \mathbb{R}$. In this case, since $x_{0} \neq 0$, we can write any real number $c$ in the form $x_{0} y$ for some $y$ and hence we conclude that $f(c)=0$. It is clear that the zero function satisfies the given equation. Now assume that $f\left(x^{2}\right) \neq 0$ for all $x \neq 0$.
By $P(1, y)$ we have

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

If $f(1) \neq 1$, there exists a real number $y$ satisfying $1+y f(1)=y$ which means that $f(1)=0$ which is a contradiction since $f\left(x^{2}\right) \neq 0$ for all $x \neq 0$. Therefore we get $f(1)=1$. Considering $P\left(x,-x / f\left(x^{2}\right)\right)$ for $x \neq 0$, we obtain that

$$
f(x)=-x f\left(-\frac{x^{2}}{f\left(x^{2}\right)}\right) \quad \forall x \in \mathbb{R} \backslash\{0\} .
$$

Replacing $x$ by $-x$ in (1), we obtain $f(x)=-f(-x)$ for all $x \neq 0$. Since $f(0)=0$, we have $f(x)=-f(-x)$ for all $x \in \mathbb{R}$. Since $f$ is odd, $P(x,-y)$ implies

$$
f\left(x-y f\left(x^{2}\right)\right)=f(x)-x f(x y)
$$

and hence by adding $P(x, y)$ and $P(x,-y)$, we get

$$
f\left(x+y f\left(x^{2}\right)\right)+f\left(x-y f\left(x^{2}\right)\right)=2 f(x) \forall x, y \in \mathbb{R}
$$

Putting $y=x / f\left(x^{2}\right)$ for $x \neq 0$ we get

$$
f(2 x)=2 f(x) \quad \forall x \in \mathbb{R}
$$

and hence we have

$$
f\left(x+y f\left(x^{2}\right)\right)+f\left(x-y f\left(x^{2}\right)\right)=f(2 x) \forall x, y \in \mathbb{R}
$$

It is clear that for any two real numbers $u$ and $v$ with $u \neq-v$, we can choose

$$
x=\frac{u+v}{2} \text { and } y=\frac{v-u}{\left.2 f\left(\frac{u+v}{2}\right)^{2}\right)}
$$

yielding

$$
f(u)+f(v)=f(u+v)
$$

Since $f$ is odd, (2) is also true for $u=-v$ and hence we obtain that

$$
f(x)+f(y)=f(x+y) \quad \forall x, y \in \mathbb{R} .
$$

Therefore, $P(x, y)$ implies

$$
f\left(y f\left(x^{2}\right)\right)=x f(x y) \quad \forall x, y \in \mathbb{R}
$$

Hence we have

$$
f\left(f\left(x^{2}\right)\right)=x f(x) \quad \forall x \in \mathbb{R}
$$

and

$$
f\left(x f\left(x^{2}\right)\right)=x f\left(x^{2}\right) \forall x \in \mathbb{R}
$$

Using (2) and (3), we get

$$
\begin{aligned}
x f(x)+y f(y)+x f(y)+y f(x) & =(x+y)(f(x)+f(y)) \\
& =f\left(f\left((x+y)^{2}\right)\right) \\
& =f\left(f\left(x^{2}+2 x y+y^{2}\right)\right) \\
& =f\left(f\left(x^{2}\right)+f\left(y^{2}\right)+f(2 x y)\right) \\
& =f\left(f\left(x^{2}\right)\right)+f\left(f\left(y^{2}\right)\right)+f(f(2 x y)) \\
& =x f(x)+y(f(y))+f(f(2 x y)) \\
& =x f(x)+y(f(y))+2 f(f(x y))
\end{aligned}
$$

and hence

$$
2 f(f(x y))=x f(y)+y f(x) \forall x, y \in \mathbb{R} .
$$

Using (5), we have

$$
2 f(f(x))=x+f(x) \quad \forall x \in \mathbb{R} .
$$

Using (3) and (6), we obtain that

$$
2 x f(x)=2 f\left(f\left(x^{2}\right)\right)=x^{2}+f\left(x^{2}\right) \forall x \in \mathbb{R} .
$$

Putting $y=f\left(x^{2}\right)$ in (5) yields

$$
2 f\left(f\left(x f\left(x^{2}\right)\right)\right)=x f\left(f\left(x^{2}\right)\right)+f\left(x^{2}\right) f(x) \forall x \in \mathbb{R}
$$

Using (4), we get $f\left(f\left(x f\left(x^{2}\right)\right)\right)=x f\left(x^{2}\right)$ and by (3) and (8) we have

$$
2 x f\left(x^{2}\right)=2 f\left(f\left(x f\left(x^{2}\right)\right)\right)=x f\left(f\left(x^{2}\right)\right)+f\left(x^{2}\right) f(x)=x^{2} f(x)+f\left(x^{2}\right) f(x) \forall x \in \mathbb{R}
$$

Now using (7), write $f\left(x^{2}\right)=2 x f(x)-x^{2}$ in (9) to obtain that

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

which is equivalent to

$$
2 x(x-f(x))^{2}=0 \quad \forall x \in \mathbb{R}
$$

This shows that $f(x)=x \quad \forall x \in \mathbb{R}$ which satisfies the original equation. Therefore all solutions are $f(x)=0 \quad \forall x \in \mathbb{R}$ and $f(x)=x \quad \forall x \in \mathbb{R}$.