Solution by maromex.
Let P(x,y) denote the given assertion f(x2+xy)=f(x)2+f(xy).
P(0,0):f(0)=f(0)2+f(0), so f(0)=0.
P(x,0):f(x2)=f(x)2.
This means f(x2+xy)=f(x2)+f(xy) for all real x,y. For any positive real numbers s,t, there exist positive reals x,y with x2=s and xy=t. So f(s+t)=f(s)+f(t) for all s,t>0. As f(x2)=f(x)2≥0, we have f(x)≥0 for all x≥0.
As f is, on positive reals, additive and bounded below, we have f(x)=cx for all positive real x for some real constant c. Because f(x2)=f(x)2⟹cx2=c2x2 we have c∈{0,1}.
P(x,−x):0=f(x)2+f(−x2)=f(x2)+f(−x2).
This means f(−x)=−f(x) for all x≥0. Therefore f(x)=cx for all x<0 as well. As f(0)=0, we have f(x)=cx for all x.
So f(x)=0 for all x or f(x)=x for all x. Checking, both of these functions work.