Functional Equation $f(xf(y) + f(x)) + f(y^2) = f(x) + y(f(x+y))$ Determine all the functions $f : \mathbb{R} \rightarrow \mathbb{R}$ such that for every $x,y \in \mathbb{R}$ is valid that:
$$
f(xf(y) + f(x)) + f(y^2) = f(x) + y(f(x+y))
$$

I've been trying this problem for hours and still haven't got the solution... I'll say what I've concluded by now and what I'm trying to prove in order to get the solution.
After varying $x$ and $y$ I was able to show that $f(f(x)) = f(x)$ for every $x \in \mathbb{R}$. From that, we can see that if $r \in \text{im}(f)$ then $\exists x \in \mathbb{R}$ such that:
$$
\begin{align*}
f(x) &= r\\
f(f(x)) &= f(r)\\
f(x) &= f(r)\\
r &= f(r)
\end{align*}
$$
With this we can say that $f(x) = x$ for every $x \in \text{im}(f)$. Now If I prove that $f$ is surjective, than $f(x) = x$.
I was also able to conclude that $f(y^2) = yf(y)$, and therefore it's valid that:
$$
\begin{align*}
f(xf(y) + f(x)) &= f(x) + y(f(x+y)) - f(y^2)\\
&= f(x) + y(f(x+y)) - yf(y)\\
&= f(x) + y( f(x+y) - f(y) )
\end{align*}
$$
So now if I'm able to show that for every $x \in \mathbb{R}\setminus \{0\}$ it holds that $f(x+y) - f(y) \neq 0$, then we fix $x$ and vary $y$ to get by isolation that $f$ is surjective.
Now, aiming in a contradiction, assume that $\exists x_0 \in \mathbb{R} \setminus \{0\}$ such that $f(x_0 + y) - f(y) = 0$. Now assume that $f$ is injective. Therefore:
$$
\begin{align*}
f(x_0+y) &= f(y)\\
&\implies x_0 + y = y\\
&\implies x_0 = y-y = 0
\end{align*}
$$
Which is a contradiction since $x \in \mathbb{R} \setminus \{0\}$, therefore $f(x_0 + y) - f(y) \neq 0$ for all these x's.
But to prove that I needed to assume that $f$ is injective, in which I wasn't able to prove...
So I'm in need to show that $f$ is injective. That is going to imply that $f$ is surjective and since $f(x) = x$ for all $x$'s in the image of $f$ it would follow by surjectivity that $im(f)$ = $\mathbb{R}$ and finally $f(x) = x$ for all real $x$'s.
Can someone please help me to prove that $f$ is injective? That might be impossible, but if it's possible then by my reasoning the question would be answered right?
Oh, and of course $f \equiv 0$ is also a solution.
Is that a really hard problem or am I just missing the key points to reach the solution?
 A: It's easy to see that both $ f ( x ) = 0 $ and $ f ( x ) = x $ satisfy
$$ f \big( x f ( y ) + f ( x ) \big) + f \big( y ^ 2 \big) = f ( x ) + y f ( x + y ) \text . \tag 0 \label 0 $$
You can show that those are the only solutions. I repeat some of your arguments, for the sake of completeness.
Letting $ x = y = 0 $ in \eqref{0} we have $ f \big( f ( 0 ) \big) = 0 $. Plugging $ x = 0 $ and $ y = f ( 0 ) $ in \eqref{0} we get $ f \big( f ( 0 ) ^ 2 \big) = f ( 0 ) $. Then, letting $ x = f ( 0 ) $ and $ y = 0 $ in \eqref{0} we get $ f ( 0 ) = 0 $. Now, plugging $ y = 0 $ in \eqref{0} we have
$$ f \big( f ( x ) \big) = f ( x ) \tag 1 \label 1 $$
and letting $ x = 0 $ in \eqref{0} we have
$$ f \big( y ^ 2 \big) = y f ( y ) \text . \tag 2 \label 2 $$
\eqref{2} shows that $ f ( - y ) = - f ( y ) $ for $ y \ne 0 $, and as also $ f ( 0 ) = 0 = - f ( 0 ) $, $ f $ is an odd function. Substituting $ f ( y ) $ for $ y $ in \eqref{0} and using \eqref{1} we get
$$ f \big( x f ( y ) + f ( x ) \big) - f ( x ) = f ( y ) f \big( x + f ( y ) \big) - f \big( f ( y ) ^ 2 \big) \text . \tag 3 \label 3 $$
Comparing \eqref{0} and \eqref{3} gives
$$ y f ( x + y ) - f \big( y ^ 2 \big) = f ( y ) f \big( x + f ( y ) \big) - f \big( f ( y ) ^ 2 \big) \text . \tag 4 \label 4 $$
Now letting $ x = - y $ in \eqref{4} we have
$$ f \big( f ( y ) ^ 2 \big) - f \big( y ^ 2 \big) = f ( y ) f \big( f ( y ) - y \big) \text . \tag 5 \label 5 $$
On the other hand, letting $ x = - f ( y ) $ in \eqref{4} we get
$$ y f \big( y - f ( y ) \big) = f \big( y ^ 2 \big) - f \big( f ( y ) ^ 2 \big)  \text . \tag 6 \label 6 $$
Putting \eqref{5} and \eqref{6} together and noting that $ f $ is odd, we have
$$ \big( y + f ( y ) \big) f \big( y - f ( y ) \big) = 0 \text . \tag 7 \label 7 $$
Now, assume there is $ a \ne 0 $ with $ f ( a ) = 0 $. Let $ y = a $ in \eqref{4} and use \eqref{2} to get that $ f $ is constantly zero. Otherwise, the only $ a $ with $ f ( a ) = 0 $ would be $ 0 $. This using \eqref{7} shows that if $ f ( y ) \ne y $ then $ f ( y ) = - y $. Therefore we must have $ f ( y ) \in \{ \pm y \} $, and hence $ f ( y ) ^ 2 = y ^ 2 $, which substituting $ f ( y ) $ for $ y $ in \eqref{2} and using \eqref{1} yields $ f \big( y ^ 2 \big) = y ^ 2 $. Comparing this with \eqref{2} we get $ f ( y ) = y $ for $ y \ne 0 $, and since also $ f ( 0 ) = 0 $, $ f $ is the identity function.
