Answer: f(x)=a(x+2a), g(x)=a(1−2a)(x+2a), a∈R.
(Solution by A. Goloubitskaya, L. Manzhulina.) First, we claim that f takes the value 0. If f(0)=0, then there is nothing to prove. If f(0)=b=0, then setting x=0 in the given equality
f(x−2f(y))=xf(y)−yf(x)+g(x),(1)
we obtain f(−2f(y))=−by+g(0). The right-hand side attains all real values since b=0. So f attains all real values including 0.
Let c be such that f(c)=0. Set y=c in (1): f(x)=−cf(x)+g(x), whence g(x)=(c+1)f(x). Therefore, (1) becomes
f(x−2f(y))=xf(y)+(c+1−y)f(x).(2)
Let a=f(c+1). Substituting c+1 for y in (2), we obtain f(x−2a)=ax, whence f(x)=ax+2a2. Since f(c)=0, we have ac+2a2=0 and
g(x)=(c+1)(ax+2a2)=(−2a2+a)x−4a3+2a2.
Easy verification shows that these functions f and g satisfy the given equality for all real a.