Solution by jasperE3.
We solve the general equation f(g(x)+yf(x))=f(x2)+f(xy).
If f(k)=0 for some k:
P(k,x)⇒f(g(k))=f(k2)+f(kx), so f is constant, only constant solution is f(x)=0 which fits.
Otherwise assume f(x)=0 for all x=0.
If f(k)=k for some k.
P(k,k−f(k)g(k))⇒f(k2)=0⇒k2=0, but then f(0)=0 so f(k)=f(0)=0=k, contradiction.
Therefore f(x)=x for all x.