Find all functions $f$ from $\mathbb{R}$ to $\mathbb{R}$ satisfying the following condition:

$$
\forall x, y \in \mathbb{R}, \quad f(x-f(y))=f(f(y))+x f(x)+x^{2}
$$
Consider the set $E=\{f(x)-f(y) \mid x, y \in \mathbb{R}\}$.

By considering the quantity $f(x-f(y))-f(x)=f(f(y))+x f(y)-1$ and varying $x$ while keeping $y$ fixed, we realize that (except in the case $f(y)=0$) this quantity spans $\mathbb{R}$. Since the zero function is clearly not a solution, we can indeed find such a $y$, proving that $E=\mathbb{R}$.

By substituting $f(x)$ for $x$ in the original equation, we show that:

$$
\forall x, y \in \mathbb{R}, \quad f(f(x)-f(y))=f(f(y))+f(x) f(y)+f(f(x))-1
$$

By exploiting the symmetry of the right-hand side, we obtain that $f(f(x)-f(y))=f(f(y)-f(x))$. We immediately notice that this can be written as $\forall a \in E, f(a)=f(-a)$, hence (since $E=\mathbb{R}$), $f$ is even.

Using this evenness and setting $x=0$ in the original equation, we directly obtain that $f(0)=1$.

Furthermore, by substituting $f(y)$ for $x$ in the original equation, we get:

$$
\forall y \in \mathbb{R}, \quad f(0)=f(f(y))+f(y)^{2}+f(f(y)), \text{ hence } \forall y \in \mathbb{R}, \quad f(f(y))=1-\frac{f(y)^{2}}{2}
$$

Using this relation in the equation $f(f(x)-f(y))=f(f(y))+f(x) f(y)+f(f(x))-1$, we obtain that:

$$
f(f(x)-f(y))=1-\frac{f(y)^{2}}{2}+f(x) f(y)+1-\frac{f(x)^{2}}{2}-1=1-\frac{(f(x)-f(y))^{2}}{2}
$$

Thus, we have shown that for all $a$ in $E, f(a)=1-\frac{a^{2}}{2}$. Since $E=\mathbb{R}$, the only possible solution is $x \longleftrightarrow 1-\frac{x^{2}}{2}$, which indeed satisfies the equation.