It's straightforward to verify that $ f ( x ) = 0 $ and $ f ( x ) = x ^ 2 + a $ for any constant $ a \in \mathbb R $ satisfy
$$ f \bigl ( x - f ( y ) \bigr ) = f ( - x ) + \bigl ( f ( y ) - 2 x \bigr ) f ( - y ) \tag 0 \label 0 $$
for all $ x , y \in \mathbb R $. We show that these are the only solutions. For this, first note that for any $ y , z \in \mathbb R $ if we have $ f ( y ) = f ( z ) $ then we also have $ f ( - y ) = f ( - z ) $, as can be seen by choosing $ x $ in \eqref{0} such that $ f ( y ) \ne 2 x $. For example, one can set $ x = \frac { f ( y ) - 1 } 2 $ in \eqref{0} to get
$$ f ( - y ) = f \left ( - \frac { 1 + f ( y ) } 2 \right ) - f \left ( \frac { 1 - f ( y ) } 2 \right ) $$
for all $ y \in \mathbb R $, which clearly has the desired property as a consequence. Letting $ a = f ( 0 ) $ and putting $ x = 0 $ in \eqref{0} we get
$$ f \bigl ( - f ( y ) \bigr ) = f ( y ) f ( - y ) + a \tag 1 \label 1 $$
for all $ y \in \mathbb R $. Substituting $ - y $ for $ y $ in \eqref{1} and comparing to \eqref{1} itself, we have $ f \bigl ( - f ( y ) \bigr ) = f \bigl ( - f ( - y ) \bigr ) $, and thus
$$ f \bigl ( f ( y ) \bigr ) = f \bigl ( f ( - y ) \bigr ) \tag 2 \label 2 $$
for all $ y \in \mathbb R $. Setting $ y = 0 $ in \eqref{0}, we get
$$ f ( x - a ) = f ( - x ) + a ( a - 2 x ) \tag 3 \label 3 $$
for all $ x \in \mathbb R $. Now, substituting $ - f ( y ) $ for $ x $ in \eqref{3} we have
$$ f \bigl ( - f ( y ) - a \bigr ) = f \bigl ( f ( y ) \bigr ) + a \bigl ( a + 2 f ( y ) \bigr ) \text , $$
while setting $ x = - a $ in \eqref{0} gives
$$ f \bigl ( - a - f ( y ) \bigr ) = f \bigl ( a \bigr ) + \bigl ( f ( y ) + 2 a \bigr ) f ( - y ) $$
for all $ y \in \mathbb R $. Comparing the last couple of equations, we get
$$ f \bigl ( f ( y ) \bigr ) = 2 a \bigl ( f ( - y ) - f ( y ) \bigr ) + f ( y ) f ( - y ) + f ( a ) - a ^ 2 \tag 4 \label 4 $$
for all $ y \in \mathbb R $. Substituting $ - y $ for $ y $ in \eqref{4} and comparing to \eqref{4} itself, we get $ a \bigl ( f ( - y ) - f ( y ) \bigr ) = 0 $ for all $ y \in \mathbb R $, using \eqref{2}. Now, if for some $ y \in \mathbb R $ we had $ f ( - y ) \ne f ( y ) $, then we would have $ a = 0 $, which then contradicts \eqref{3}. Therefore, we must have
$$ f ( - y ) = f ( y ) $$
for all $ y \in \mathbb R $, which helps us rewrite \eqref{0} as
$$ f \bigl ( x - f ( y ) \bigr ) = f ( x ) + \bigl ( f ( y ) - 2 x \bigr ) f ( y ) \text , \tag 5 \label 5 $$
and \eqref{1} as
$$ f \bigl ( f ( y ) \bigr ) = f ( y ) ^ 2 + a \text . \tag 6 \label 6 $$
Substituting $ f ( x ) $ for $ x $ in \eqref{5} and using \eqref{6}, we get
$$ f \bigl ( f ( x ) - f ( y ) \bigr ) = \bigl ( f ( x ) - f ( y ) \bigr ) ^ 2 + a \tag 7 \label 7 $$
for all $ x , y \in \mathbb R $. Now, if there is some $ b \in \mathbb R $ with $ f ( b ) \ne 0 $, substituting $ \frac { x + f ( b ) ^ 2 } { 2 f ( b ) } $ for $ x $ and $ b $ for $ y $ in \eqref{5} we get
$$ f \left ( \frac { x + f ( b ) ^ 2 } { 2 f ( b ) } \right ) - f \left ( \frac { x - f ( b ) ^ 2 } { 2 f ( b ) } \right ) = x \text , $$
which then substituting $ \frac { x + f ( b ) ^ 2 } { 2 f ( b ) } $ for $ x $ and $ \frac { x - f ( b ) ^ 2 } { 2 f ( b ) } $ for $ y $ in \eqref{7}, gives us $ f ( x ) = x ^ 2 + a $ for all $ x \in \mathbb R $. Therefore, the function $ f $ must be of this form, unless it is the constant zero function.