<s>[INST] Question regarding surjectivity of a nonzero function satisfying $ f \big( a + 2 f ( a ) f ( b ) \big) = f ( a ) + 2 a f ( b ) $ I was practicing that how to prove surjectivity of functions in a functional equation and I came across the following question.

Let $ f : \mathbb R \to \mathbb R $ be a function such that
$$ f \big( a + 2 f ( a ) f ( b ) \big) = f ( a ) + 2 a f ( b ) $$
for all $ a , b \in \mathbb R $. Also, suppose that $ f $ is not the all-zero function. Prove that $ f $ is surjective.

I really don't have any idea about how to prove it. A pedantic and easiest possible proof will be highly appreciated and would be helpful.
 [/INST] Consider a function $ f : \mathbb R \to \mathbb R $ such that
$$ f \big( a + 2 f ( a ) f ( b ) \big) = f ( a ) + 2 a f ( b ) \tag 0 \label 0 $$
for all $ a , b \in \mathbb R $ which is not the constant zero function. Setting $ a = b = - \frac 1 2 $ in \eqref{0} gives
$$ f \left( - \frac 1 2 + 2 f \left( - \frac 1 2 \right) ^ 2 \right) = 0 \text . \tag 1 \label 1 $$
For any $ a \in \mathbb R $ with $ f ( a ) = 0 $, \eqref{0} gives $ a f ( b ) = 0 $. In case $ a \ne 0 $, that shows that $ f $ is the constant zero function, contrary to the assumption. Thus such $ a $ must be equal to $ 0 $, which by \eqref{1} not only shows that $ f ( 0 ) = 0 $, but also $ - \frac 1 2 + 2 f \left( - \frac 1 2 \right) ^ 2 = 0 $, or equivalently $ f \left( - \frac 1 2 \right) = - \frac k 2 $ where $ k ^ 2 = 1 $, i.e. $ k \in \{ - 1 , 1 \} $. Now, setting $ b = - \frac 1 2 $ in \eqref{0} shows that
$$ f \big( a - k f ( a ) \big) = f ( a ) - k a \text , \tag 2 \label 2 $$
while plugging $ a = - \frac 1 2 $ in \eqref{0} gives
$$ f \left( - \frac 1 2 - k f ( b ) \right) = - \frac k 2 - f ( b ) \text . \tag 3 \label 3 $$
By setting $ a = \frac 1 2 $ in \eqref{2} we have $ f \Big( \frac 1 2 - k f \left( \frac 1 2 \right) \Big) = f \left( \frac 1 2 \right) - \frac k 2 $, which shows that letting $ b = \frac 1 2 - k f \left( \frac 1 2 \right) $ in \eqref{3} we get
$$ f \Bigg( - k f \left( \frac 1 2 \right) \Bigg) = - f \left( \frac 1 2 \right) \text . \tag 4 \label 4 $$
By plugging $ a = \frac 1 2 $ and $ b = - k f \left( \frac 1 2 \right) $ in \eqref{0} and using \eqref{4} we get $ f \Big( \frac 1 2 - 2 f \left( \frac 1 2 \right) \Big) = 0 $, which means that we must have $ f \left( \frac 1 2 \right) ^ 2 = \frac 1 4 $, or equivalently $ f \left( \frac 1 2 \right) = \pm \frac k 2 $. But by \eqref{4}, $ f \left( \frac 1 2 \right) = - \frac k 2 $ leads to $ f \left( \frac 1 2 \right) = - f \left( \frac 1 2 \right) $, contradicting $ f \left( \frac 1 2 \right) ^ 2 = \frac 1 4 $. Thus we have $ f \left( \frac 1 2 \right) = \frac k 2 $.
Now, assume that for some $ c \in \mathbb R $ we have $ f ( c ) = - k c $. By \eqref{3} we have $ f \left( - \frac 1 2 + c \right) = k \left( - \frac 1 2 + c \right) $. Then, setting $ x = \frac 1 2 $ and $ y = - \frac 1 2 + c $ in \eqref{0}, we get $ f ( c ) = k c $, which means that we must have $ c = 0 $. By \eqref{2}, we know that for any $ a \in \mathbb R $, letting $ c = a - k f ( a ) $ we have $ f ( c ) = - k c $, and therefore we must have $ k f ( a ) = a $, or equivalently $ f ( a ) = k a $. Hence, $ f $ has to either be the identity function or its opposite. It's straightforward to verify that those are both surjective solutions.

\eqref{0} is a variant of the functional equation
$$ f \big( a + f ( a ) f ( b ) \big) = f ( a ) + a f ( b ) \text , $$
which has appeared in The American Mathematical Monthly, with an official answer here. This question has been asked many times on AoPS, and you can for example find solutions here, here, here, here and here. The official answer and several others first prove surjectivity and then use that to characterize the solutions of the equation. The answer I gave above is similar to the one in the last linked page. Not only it doesn't appeal to surjectivity first, but also it's shorter and simpler than all others.

Wu Wei Chao, and The University of Louisiana at Lafayette Math Club, Two Functional Equations: 11053, The American Mathematical Monthly 112 (2005), no. 7, 661--662.
</s>