Let P(x,y) denote the given functional equation.
P(x,0)→f(xf(0)−f(x))=−x−f(0).
From this we know that f is surjective, and f(f(x))=x. Note that
P(1,1)→f(−1)=−1 and P(0,−1)→f(1−f(0))=1−f(0).
Consider x=0,y=1−f(0):
−1=f(−1)=(1−f(0))f(0)−f(1−f(0))=−(1−f(0))2⇔f(0)=0 or 2.
If f(0)=2, then P(x,0) becomes
f(2x−f(x))=−x−2=f(f(−x−2))
By injectivity we obtain the following system of equations
{2x−f(x)=f(−x−2)2(−x−2)−f(−x−2)=f(x)
which is clearly a contradiction. Therefore f(0)=0 and f(−x)=−f(x). In particular, f(1)=1. Since f is an odd function,
P(x,f(−x))→f(−x2)=−f(x)2⇔f(x)2=f(x2).
Finally, according to the following identity,
P(x,1)→f(x−f(x)−1)=f(x)−x−1.
Suppose x−f(x)=α, and recursing on the above identity, by induction we obtain
f(α2n−1)=−α2n−1 holds for all n∈{0}∪{positive integers}.
Clearly α=0 would contradict f(x2)=f(x)2≥0, therefore
f(x)=x,∀x∈R.