Solution by NO_SQUARES.
“The answer is f≡0, f(x)≡x and f(x)≡−2x.
f≡0 clearly works. From now suppose that there exists y0 such that f(y0)=0. P(x,y0) gives f(...)=2xf(y0), so f is a surjective function.
Suppose that for some x0 we have f(x0)=−x0. Then P(x0,y) gives f(0)=2x0f(y), so x0=0, because f is surjective.
For an arbitrary number d there exists a number y such that f(y)=d. P(x,y) gives f(xd+f(x)d)=2xd for all real numbers x and d.
Now suppose that x=0 and put d=x+f(x)t (we have x+f(x)=0). We obtain f(t)=2x⋅x+f(x)t or f(t)f(x)+xf(t)=2xt. Putting x=1, we get f(t)=1+f(1)2⋅t=ct for all t. Note that c=0.
Now we have c(xcy+cxcy)=2xcy, so c+c2=2, i.e. (c−1)(c+2)=0 and so c=1 or c=2, as we wanted to prove. ”