Let P(x,y) be the given assertion,
P(0,1):f(0)=0
Assume that there exists a=0 such that f(a)=0. Then P(x,a):
xf(x)+af(xa)=xf(x)⇒∀x∈R f(xa)=0⇒∀x∈R f(x)=0
And we found the first solution.
Let us now assume that f is not identically zero, so f(x)=0⇔x=0
P(−1,1):0=−f(−1)+f(−1)=−f(−1+f(1))⇒f(1)=1
P(x,1):xf(x)+f(x)=xf(x+1)⇒(x+1)f(x)=xf(x+1)⇒∀x=0,−1
xf(x)=x+1f(x+1)(1)
We already have that f(1)=1, so we can get from (1) that ∀n∈N f(n)=n. Also, we can obtain from (1) that f(−2)=2f(−1).
P(−1,2):−f(−1)+2f(−2)=−f(−1+2f(2))=−f(3)=−3⇒f(−1)=−1
By combining this with (1) we can get that ∀n∈Z f(n)=n.
Let us now show that ∀n∈Z and ∀x∈R, (x+n)f(x)=xf(x+n). If x∈Z this is obvious, otherwise we can write that xf(x)=x+1f(x+1)=⋯=x+nf(x+n) and obtain this equality.
P(x,n):xf(x)+nf(nx)=xf(x+nf(n))⇒xf(x)+nf(nx)=xf(x+n2)=(x+n2)f(x)⇒xf(x)+nf(nx)=xf(x)+n2f(x)⇒f(nx)=nf(x).(2)
After we'll divide P(x,y) by x=0:
f(x)+xyf(xy)=f(x+yf(y)).(4)
P(1,y):1+yf(y)=f(1+yf(y))
Let us now put x=yf(y) in (1), so yf(y)f(yf(y))=yf(y)+1f(yf(y)+1)=1⇒
f(yf(y))=yf(y).(3)
Put x=xf(x) there and by symmetry we'll get the following:
f(xf(x))+xf(x)yf(xyf(x))⇒f(xf(x))−yf(y)xf(xyf(y))=f(xf(x)+yf(y))=f(yf(y))+yf(y)xf(xyf(y))=f(yf(y))−xf(x)yf(xyf(x))
If we put here 2x instead of x there, then the LHS will increase by 4 times because of (2) and the RHS will not change, so both are zero and hence, f(xf(x))=yf(y)xf(xyf(y))⇒
f(xyf(y))=f(x)yf(y)(5)
Let us put x=x+1 into (5):
f(x+1)yf(y)=f((x+1)yf(y))=f(xyf(y)+yf(y))=(4)f(xyf(y))+xyf(y)yf(xy2f(y))=(5)f(x)yf(y)+xyf(y)y2f(y)f(xy)=f(x)yf(y)+xyf(xy)
So, (f(x+1)−f(x))x=f(y)f(xy) and by substituting y=1 here, we are getting that
(f(x+1)−f(x))x=f(x)⇒f(xy)=f(x)f(y)(6)
By using (6) in (3) we get that f(f(y))=y. So
P(f(y),y):f(y)y+yf(f(y)y)=f(y)f(f(y)+yf(y))⇒f(y)y+y2f(y)=yf(y)f(y+1)⇒f(y+1)=y+1⇒∀x∈R f(x)=x is the second solution.