Find all functions $f$ that assign a real number $f(x)$ to every real number $x$ such that $$(x+y)f(x)+f(y^2)=(x+y)f(y)+f(x^2)$$
I've tried subbing in heaps of values but I keep getting things like $f(0)=f(0)$ and other such useless results.
Any help would be hugely appreciated.
Put $y = 1$
$$ (x+1)f(x) + f(1) = (x+1)f(1) + f(x^2)$$
Put $y = 0$
$$ xf(x) + f(0) = xf(0) + f(x^2)$$
and subtract latter from former, we get
$$f(x) + f(1) - f(0) = x(f(1) - f(0)) + f(1)$$
and so
$$f(x) = x(f(1) - f(0)) + f(0)$$
Since any $f(x) = ax+b$ is a solution, you are done.