Solution by maromex.
Let P(x,y) denote the given assertion f(f(x)+f(xy))=f(x)+xy.
Claim: f is surjective.
Proof: P(1,t−f(1)):f(?)=t for any real t. □
For any real number t, let s be a real number satisfying f(s)=t−f(0).
P(s,0):f(t)=t−f(0).
So f(x)=x−f(0) for all real x. Plugging this into the given equation, we get x+xy−3f(0)=x+xy−f(0). Therefore f(0)=0.
It follows that f(x)=x for all real numbers x. This function works.