Solution by benjaminchew13.
Let P(x,y) denote f(x2+f(x)f(y))=x2+xy.
Obviously this is surjective. taking any nonzero x gives that f is injective.
So f is bijective.
P(0,0):f(f(0)2)=0.
P(0,f(0)2):f(0)=0.
P(x,0):f(x2)=x2, so f(x)=x for all x≥0.
P(x,−x):f(x)f(−x)=−x2, so we have f(∣x∣)f(−∣x∣)=−x2.
f(∣x∣)=∣x∣, so ∣x∣f(−∣x∣)=−x2, and so f(−∣x∣)=−∣x∣ for all x=0.
So f(x)≡x, which can be easily verified to be a solution.