Setting x=y gives 0=f(0)(f(2x)−1), ∀x∈R.
First case: f(0)=0
We have f(2x)−1=0, ∀x∈R, so f(x)=1, ∀x∈R. We check that this function is a solution.
Second case: f(0)=0
Setting y=0 gives f(f(x))−f(x)=f(x)(f(x)−1), i.e.
f(f(x))=(f(x))2,∀x∈R.(⋆)
Interchanging x and y gives f(x+f(y))−f(y+f(x))=f(y−x)(f(x+y)−1), which added to the starting equation gives
0=(f(x+y)−1)(f(x−y)+f(y−x)),∀x,y∈R.
Setting y=−x in thus obtained equation gives 0=(f(0)−1)(f(2x)+f(−2x)), so f(0)=0 implies f(2x)=−f(−2x), ∀x∈R and hence the function f is odd.
Now we conclude
f(f(x))=∗(f(x))2=(−f(−x))2=(f(−x))2=∗f(f(−x))=−f(−f(−x))=−f(f(x)),(⋆⋆)
for every x∈R
Finally, (⋆⋆) and (⋆) give 2f(f(x))=0, so 2(f(x))2=0. We check directly that f(x)=0, ∀x∈R is also a solution.