Find all functions $f: \mathbb{R} \longrightarrow \mathbb{R}$ such that $f(0)=0$, and for all $x, y \in \mathbb{R}$,

$$
(x-y)\left(f\left(f(x)^{2}\right)-f\left(f(y)^{2}\right)\right)=(f(x)+f(y))(f(x)-f(y))^{2}
$$
We suspect a remarkable identity in disguise, so we guess that the solutions will be linear functions. We set $y=0$ to find $f\left(f(x)^{2}\right)=f(x)^{3}$. This will help linearize the equation and make it more elegant. We can rewrite $(x-y)\left(f(x)^{3}-f(y)^{3}\right)=$ $(f(x)+f(y))(f(x)-f(y))^{2}$. At this point, we are tempted to expand since some terms will cancel out. After simplification, we find

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

We observe that this equation is polynomial in $f(x)$, so we set $y=1$ to keep only the variable $x$ and call $f(1)=c$. We obtain by rearranging the terms:

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

We want $f(x)=c x$ to be a solution to our functional equation, so we can probably factor by $f(x)-c x$. Indeed, this gives $(f(x)-c x)\left(f(x)^{2}-c^{2} x\right)=0$. For $x \neq 0$, this term cannot be zero, so $f(x)=c x$. The best way to conclude is by showing the oddness of the function, which we do by replacing $y$ with $-x$ in equation $(\star)$. Indeed, by factoring by $(f(x)+f(-x))$ and grouping the terms, we find $(f(x)+f(-x))^{3}=0$, so $f(x)=-f(-x)$. The solutions are therefore the linear functions, which satisfy the equation reciprocally.