19. A5 (JAP) ${ }^{\mathrm{IM} 06}$ Find all the functions $f: \mathbb{R} \rightarrow \mathbb{R}$ that satisfy
$$
f(x-f(y))=f(f(y))+x f(y)+f(x)-1
$$
for all $x, y \in \mathbb{R}$.
19. Let $A=\{f(x) \mid x \in \mathbb{R}\}$ and $f(0)=c$ Plugging in $x=y=0$ we get $f(-c)=f(c)+c-1$, hence $c \neq 0$. If $x \in A$, then taking $x=f(y)$ in the original functional equation we get $f(x)=\frac{c+1}{2}-\frac{x^{2}}{2}$ for all $x \in A$.
We now show that $A-A=\left\{x_{1}-x_{2} \mid x_{1}, x_{2} \in A\right\}^{2}=\mathbb{R}$. Indeed, plugging in $y=0$ into the original equation gives us $f(x-c)-f(x)=c x+f(c)-1$, an expression that evidently spans all the real numbers. Thus, each $x$ can be represented as $x=x_{1}-x_{2}$, where $x_{1}, x_{2} \in A$. Plugging $x=x_{1}$ and $f(y)=x_{2}$ into the original equation gives us
$$
f(x)=f\left(x_{1}-x_{2}\right)=f\left(x_{1}\right)+x_{1} x_{2}+f\left(x_{2}\right)-1=c-\frac{x_{1}^{2}+x_{2}^{2}}{2}+x_{1} x_{2}=c-\frac{x^{2}}{2} .
$$

Hence we must have $c=\frac{c+1}{2}$, which gives us $c=1$. Thus $f(x)=1-\frac{x^{2}}{2}$ for all $x \in \mathbb{R}$. It is easily checked that this function satisfies the original functional equation.