Functional equation $xf(y)+yf(x)=f(x+y)^2-f\left(x^2\right)-f\left(y^2\right)$ Here is a nice problem:

Let $f:\mathbb R\to\mathbb R$ be a function, $\mathbb R$ is the set of real numbers, satisfying the following properties: $f(1)$ is an integer and
$$xf(y)+yf(x)=f(x+y)^2-f\left(x^2\right)-f\left(y^2\right)\text,$$
for all real numbers $ x , y $.

$f(x)=0$ is a solution, another is $ f(x)=x $. These are all solutions?
Better asking: determine all functions that satisfy the above conditions.
I would like to see a complete solution! Thank you!
 A: You can show that the only functions $ f : \mathbb R \to \mathbb R $ satisfying
$$ x f ( y ) + y f ( x ) = f ( x + y ) ^ 2 - f \left( x ^ 2 \right) - f \left( y ^ 2 \right) \tag 0 \label 0 $$
are the constant zero function and the identity function. It's easy to check that those in fact are solutions. We try to prove the converse.
Defining $ a = f ( 0 ) $ and plugging $ y = 0 $ in \eqref{0} we get
$$ f \left( x ^ 2 \right) = f ( x ) ^ 2 - a ( x + 1 ) \text . \tag 1 \label 1 $$
This, in particular shows $ a \in \{ 0 , 2 \} $, as is seen by putting $ x = 0 $. Defining $ b = f ( - 1 ) $ and putting $ x = - 1 $ in \eqref{1}, we get $ f ( 1 ) = b ^ 2 $, which then letting $ x = 1 $ in \eqref{1} gives $ b ^ 4 - b ^ 2 - 2 a = 0 $. Using \eqref{1}, we can rewrite \eqref{0} as
$$ x f ( y ) + y f ( x ) = f ( x + y ) ^ 2 - f ( x ) ^ 2 - f ( y ) ^ 2 + a ( x + y + 2 ) \text . \tag 2 \label 2 $$
Now, substituting $ x - 1 $ for $ x $ and $ 1 $ for $ y $ in \eqref{2} we get
$$ b ^ 2 ( x - 1 ) + f ( x - 1 ) = f ( x ) ^ 2 - f ( x - 1 ) ^ 2 - b ^ 4 + a ( x + 2 ) \text , $$
while letting $ y = - 1 $ in \eqref{2} we have
$$ b x - f ( x ) = f ( x - 1 ) ^ 2 - f ( x ) ^ 2 - b ^ 2 + a ( x + 1 ) \text . \tag 3 \label 3 $$
Combining the last two equations we get
$$ f( x - 1 ) - f ( x ) + \left( b ^ 2 + b - 2 a \right) x = - b ^ 4 + 3 a \text . \tag 4 \label 4 $$
In particular, for $ x = 0 $ this shows that $ b ^ 4 + b - 4 a = 0 $, which together with $ b ^ 4 - b ^ 2 - 2 a = 0 $ gives $ b ( b + 1 ) \left( b ^ 2 - b - 1 \right) = 0 $ by eliminating $ a $ from the equations. Using these equations and $ a \in \{ 0 , 2 \} $, it's straightforward to check that $ b ^ 2 - b - 1 $ can't be equal to $ 0 $, and thus we must have $ b \in \{ 0 , - 1 \} $ and $ a = 0 $. If $ b = 0 $, then by \eqref{4} we will have $ f ( x - 1 ) = f ( x ) $, which together with \eqref{3} shows that $ f $ if the constant zero function. If $ b = - 1 $, then $ f ( 1 ) = b ^ 2 = 1 $, and \eqref{4} will give $ f ( x + 1 ) = f ( x ) + 1 $. Thus letting $ y = 1 $ in \eqref{2} we'll get
$$ x + f ( x ) = \left( f ( x ) ^ 2 + 2 f ( x ) + 1 \right) - f ( x ) ^ 2 - 1 \text , $$
which shows that $ f ( x ) = x $.
A: $x=y$
$$2xf(x)=f(2x)^2-2f(x^2)\\(x=y=0)0=f(0)^2-2f(0)\implies f(0)=0 \lor 2\\xf(0)=f(x)^2-f(x^2)-f(0)\\(x+1)f(0)=f(x)^2-f(x^2)\\2f(0)=f(1)^2-f(1)$$
From this we can conclude $f(0)=0$ since if $f(0)=2$ then by replacing $x=f(1)$,we get quadratic equation which has no integer solutions($x^2-x-4$),so
$$0=f(x)^2-f(x^2)\\f(x)^2=f(x^2)\\f(x)=x^c\\2x^{c+1}=(2x)^{2c}-2x^{2c}\\2x^{c+1}=2x^{2c}(2^{2c-1}-1)\\1=x^{c-1}(2^{2c-1}-1)$$
since $2^{2c-1}-1$ is a constant means $x^{c-1}$ has to be a constant,and since the equation is valid for all x in reals,means c=1,so the solutions are $f(x)=x$ and $f(x)=0$
Note the $f(x)=x^c$ is what wolfram gave me,though I guess i could prove it(just would take me more time)
