Find all functions $f$ defined on the real and takes real values such that $$f(f(y))+f(x-y)=f(xf(y)-x)$$ for all $x,y\in \mathbb{R} $
My approach:
Let be x=y=o, so $f(f(0))+f(0)=f(0) \to f(f(0))=0$.
Now, defining $y=f(0),x=0$, we have $$f(f(f(0)))+f(0-f(0))=f(0f(f(0))-0)$$ $$f(0)+f(-f(0))=f(0)$$
Then $f(-f(0))=0$, but $f(f(0))=0=f(-f(0))$, in this step, it is true that $f(0)=-f(0)$? if this is true, then with $x=f(x), y=0$ $$f(f(x))=f(f(x)f(0))-f(x)$$ $$f(f(x))=f(-f(x))$$, and this implies that f is even, and how I will continued with this??
Let $(*)$ denote the equation $f(f(y))+f(x-y) = f(xf(y)-x)$.
Take $(*)$ and set $x = 0$ and $y = 0$ to get: $$f(f(0))+f(0)=f(0)$$ $$f(f(0)) = 0 \ \ [1]$$
Take $(*)$, set $x = 0$ and $y = f(0)$, and use $[1]$ to get: $$f(f(f(0)))+f(-f(0)) = f(0)$$ $$f(0)+f(-f(0)) = f(0)$$ $$f(-f(0)) = 0 \ \ [2]$$
Take $(*)$, set $x = f(0)$ and $y = f(0)$, and use $[1]$ and $[2]$ to get: $$f(f(f(0)))+f(0) = f(f(0)f(f(0))-f(0))$$ $$f(0)+f(0) = f(-f(0))$$ $$f(0) = 0 \ \ [3]$$
Take $(*)$, set $y = 0$, and use $[3]$ to get: $$f(f(0))+f(x)=f(xf(0)-x)$$ $$f(x) = f(-x) \ \forall x \in \mathbb{R} \ \ [4]$$
Take $(*)$, set $x = 0$, and use $[3]$ and $[4]$ to get: $$f(f(y))+f(-y) = f(0)$$ $$f(f(y)) = -f(y) \ \forall y \in \mathbb{R} \ \ [5]$$
If we take $[5]$ and replace $y$ with $f(y)$, we get $f(f(f(y))) = -f(f(y))$.
If we take $[5]$, apply $f$ to both sides, and use $[4]$, we get $f(f(f(y))) = f(-f(y)) = f(f(y))$.
Hence, $f(f(y)) = f(f(f(y))) = -f(f(y))$, and thus, $f(f(y)) = 0$ for all $y \in \mathbb{R}$.
Then, by $[5]$, we have $f(y) = -f(f(y)) = 0$ for all $y \in \mathbb{R}$.
Therefore, the only function $f : \mathbb{R} \to \mathbb{R}$ such that $f(f(y))+f(x-y) = f(xf(y)-x)$ for all $x,y \in \mathbb{R}$ is $f(y) = 0$.