19. A5 (JAP) ${ }^{\text {IMO6 }}$ 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 = \{ x_1 - x_2 \mid x_1, x_2 \in A \} = \mathbb{R} \). Indeed, plugging in \( y = 0 \) into the original equation gives us \( f(x - c) - f(x) = cx + 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(x_1 - x_2) = f(x_1) + x_1 x_2 + f(x_2) - 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.