Solution by jasperE3.
Let P(x,y) be the assertion f(x+f(y)2)=f(x)+yf(y).
If f(a)=f(b)=0 then P(0,a) and P(0,b) imply a=b.
Now f(x)=0 is a solution, else there is some j with f(j)=0. Also, f is a solution iff −f is, so WLOG f(1)≥0.
P(j,0)⇒f(j+f(0)2)=f(j)=0⇒j+f(0)2=j⇒f(0)=0.
P(0,x)⇒f(f(x)2)=xf(x).
In particular, f(f(1)2)=f(1). If f(1)=0 then f(1)2=1, so f(1)=1.
Case 1: f(1)=0
Since f(0)=0, j=0 and so jf(j)=0.
P(1,j)⇒f(1+f(j)2)=jf(j)=f(f(j)2).
Since f(1+f(j)2)=f(f(j)2)=0, we have 1+f(j)2=f(j)2, contradiction.
Case 2: f(1)=1
P(x,1)⇒f(x+1)=f(x)+1.
P(x,y+1)⇒f(x+f(y)2+2f(y))+1=f(x+f(y)2+2f(y)+1)=f(x)+(y+1)(f(y)+1)=f(x+f(y)2)+y+f(y)+1,
so f(x+2f(y))=f(x)+y+f(y).
Take y↦z+2f(y), we have:
f(x)+z+f(z)+y+3f(y)=f(x)+z+2f(y)+f(z+2f(y))=f(x+2f(z+2f(y)))=f(x+2f(z)+2y+2f(y))=f(x+2y)+z+f(z)+y+f(y),
which simplifies as f(x+2y)=f(x)+2f(y).
Set x=0, this is f(2y)=2f(y), so f(x+2y)=f(x)+f(2y) implying that f is additive in general.
From f(x+2f(y))=f(x)+y+f(y) we have 2f(f(y))=y+f(y) for all y, and from the original equation f(f(x)2)=xf(x). In the latter, take x↦x+y and use additivity:
xf(x)+yf(y)+xf(y)+yf(x)=f(f(x+y)2)=f(f(x)2)+2f(f(x)f(y))+f(f(y)2)=xf(x)+yf(y)+f(2f(x)f(y)),
so f(2f(x)f(y))=xf(y)+yf(x).
Take y↦f(y), we have:
f(yf(x))+2xf(y)+yf(x)=f(yf(x))+f(f(x)f(y))=f(f(x)(y+f(y)))=xf(f(y))+f(x)f(y)=2xy+xf(y)+f(x)f(y),
so f(yf(x))=2xy−yf(x)+f(x)f(y).
Set x↦2f(x)−x, noting that f(2f(x)−x)=2f(f(x))−f(x)=x, we have:
xy+f(xy)=xf(y)+yf(x).
Let g(x)=f(x)−x, it satisfies the system g(x+y)=g(x)+g(y), g(xy)=xg(y)+yg(x), and g(g(x))=−23g(x). Using these:
−3xg(x)=(2)−23g(x2)=(3)g(g(x2))=(2)g(2xg(x))=(1)2g(xg(x))=(2)2xg(g(x))+2g(x)2=(3)−3xg(x)+2g(x)2
and we conclude g(x)=0, i.e. f(x)=x for all x.
Solution −f is f(x)=−x.