Solution by jasperE3.
f(f(x)+f(x)f(y))=f(x)+f(x)f(y).
We claim that the solutions are: Let ∅=S⊆R with the closure property that if a,b∈S then a+ab∈S. Then f(x)={xg(x)if x∈Tif x∈/T where T={a+ab∣a,b∈S} and g:R∖T→S is any function.
To see that these work, note that T⊆S, so f(x)∈S whether x∈T or x∈/T. Then f(x)+f(x)f(y)∈T for all x,y∈R, so f(f(x)+f(x)f(y))=f(x)+f(x)f(y).
To see that these are all of the solutions, take S=f(R), it’s cleary that ∅=S⊆R and that S satisfies the aforementioned closure property. So for T derived from this S, f(x)=x for all x∈T and f(x)∈S for all x∈/T, hence the result.