Parallelogram law functional equation: $ f ( x + y ) + f ( x - y ) = 2 \big( f ( x ) + f ( y ) \big) $

$ \def \Q {\mathbb Q} \def \R {\mathbb R} \def \Rp {\mathbb R _ +} \def \B {\tilde B} \DeclareMathOperator \sgn {sgn} $ Assume that $ B : \R ^ 2 \to \R $ is biadditive (and hence bilinear over $ \Q $). If you define $ f : \R \to \R $ with $ f ( x ) = B ( x , x ) $ for all $ x \in \R $, then for any $ x , y \in \R $ you can verify that $$ \begin {align*} f ( x + y ) + f ( x - y ) & = B ( x + y , x + y ) + B ( x - y , x - y ) \\ & = B ( x , x + y ) + B ( y , x + y ) + B ( x , x - y ) - B ( y , x - y ) \\ & = { B ( x , x ) + B ( x , y ) + B ( y , x ) + B ( y , y ) \\ + B ( x , x ) - B ( x , y ) - B ( y , x ) + B ( y , y ) } \\ & = 2 B ( x , x ) + 2 B ( y , y ) \\ & = 2 f ( x ) + 2 f ( y ) \text . \end{align*} $$ Conversely, you can show that for any $ f : \R \to \R $ satisfying $$ f ( x + y ) + f ( x - y ) = 2 f ( x ) + 2 f ( y ) \tag 0 \label 0 $$ for all $ x , y \in \R $ (also called a quadratic function satisfying the quadratic functional equation), there is a symmetric biadditive $ B : \R ^ 2 \to \R $ such that $ f ( x ) = B ( x , x ) $ for all $ x \in \R $. To see this, define $ B : \R ^ 2 \to \R $ with $$ B ( x , y ) = \frac { f ( x + y ) - f ( x - y ) } 4 \tag 1 \label 1 $$ for any $ x , y \in \R $. You've managed to show that \eqref{0} implies $$ f ( r x ) = r ^ 2 f ( x ) \tag 2 \label 2 $$ for all $ r \in \Q $ and all $ x \in \R $. For $ r = 0 $, \eqref{2} gives $ f ( 0 ) = 0 $, and for $ r = 2 $, it gives $ f ( 2 x ) = 4 f ( x ) $ for all $ x \in \R $. These, together with letting $ y = x $ in \eqref{1}, show that $ f ( x ) = B ( x , x ) $ for all $ x \in \R $. For $ r = - 1 $, \eqref{2} shows that $ f $ is even, which by swapping $ x $ and $ y $ in \eqref{1} shows that $ B $ is symmetric. Thus, it's sufficient to prove additivity of $ B $ in the first variable, and biadditivity will follow. By evenness of $ f $ and substituting $ - x $ for $ x $ in \eqref{1}, we can see that $ B $ is odd in the first variable. By \eqref{0}, for any $ x , y , x \in \R $ we have $$ \begin {align*} 4 B ( x + y , z ) + 4 B ( x - y , z ) & = { f ( x + y + z ) + f ( x - y + z ) \\ - f ( x + y - z ) - f ( x - y - z ) } \\ & = 2 f ( x + z ) + 2 f ( y ) - 2 f ( x - z ) - 2 f ( y ) \\ & = 2 f ( x + z ) - 2 f ( x - z ) \\ & = 8 B ( x , z ) \text , \end {align*} $$ or equivalently $$ B ( x + y , z ) + B ( x - y , z ) = 2 B ( x , z ) \text . $$ Substituting $ - y $ for $ x $ and $ x $ for $ y $, we get $$ B ( - y + x , z ) + B ( - y - x , z ) = 2 B ( - y , z ) \text . $$ for all $ x , y , x \in \R $. Subtracting the last two equations, we have $$ B ( x + y , z ) - B ( - x - y , z ) = 2 B ( x , z ) - 2 B ( - y , z ) $$ for all $ x , y , x \in \R $, which by oddness of $ B $ in the first variable, proves additivity of $ B $ in the first variable.


Now, note that given any Hamel basis $ ( e _ i ) _ { i \in I } $ of $ \R $ over $ \Q $, and any "matrix" $ ( \alpha _ { i j } ) _ { i , j \in I } $ of real numbers, there is a biadditive $ B : \R ^ 2 \to \R $ such that for any $ x , y \in \R $, $$ B ( x , y ) = \sum _ { k = 1 } ^ n \sum _ { l = 1 } ^ m s _ { i _ k } \alpha _ { { i _ k } { j _ l } } t _ { j _ l } \text , $$ where $ x = \sum _ { k = 1 } ^ n s _ { i _ k } e _ { i _ k } $ and $ y = \sum _ { l = 1 } ^ m s _ { j _ l } e _ { j _ l } $. As you've noted, for any additive $ A , C : \R \to \R $, defining $ B : \R ^ 2 \to \R $ with $ B ( x , y ) = A ( x ) C ( y ) $ gives a biadditive map. But those are not the only possibilities; for example, you can add finitely many different maps of this form, and end up with another biadditive map. Even those don't cover all the possibilities; you can find a relation between the "entries" of the "matrix" of $ A ( x ) C ( y ) $ and the values of $ A $ and $ C $ at the basis points, and "construct" a "matrix" that is not a finite sum of "matrices" of that form.

You can see that the only regular biadditive functions are those of the form $ B ( x , y ) = k x y $, and consequently the only regular quadratic functions are those of the form $ f ( x ) = k x ^ 2 $, for some constant $ k \in \R $. Similar to the well-known case of additive functions, regularity here can have order theoretical, topological or measure-theoretical meanings. Any Lebesgue measurable biadditive/quadratic function must be of the mentioned form. Also, the graph of any biadditive/quadratic function not of the above form is dense. Therefore, any property implying that the graph can't be dense, will force the function to be of the mentioned form. Such properties include continuity at a point, being bounded above or below on a nontrivial compact subset of the domain, and others, much similar to the familiar ones for the case of Cauchy's functional equation. In the following, I provide proofs for these facts. I only give the proofs in terms of biadditive functions, and it should be straightforward to conclude the corresponding result for quadratic functions, from what we've already discussed.


Measurability:

Let $ B : \R ^ 2 \to \R $ be biadditive and Lebesgue measurable. For any $ y \in \R $, define $ A ^ y : \R \to \R $ with $ A ^ y ( x ) = B ( x , y ) $ for all $ x \in \R $. $ A ^ y $ is additive for every $ y \in \R $, and by Tonelli's theorem, $ A ^ y $ is Lebesgue measurable for almost every $ y \in \R $. Similarly, for any $ x \in \R $, we can define $ A _ x : \R \to \R $ with $ A _ x ( y ) = B ( x , y ) $, and $ A _ x $ will be additive for every $ x \in \R $ and Lebesgue measurable for almost every $ x \in \R $. As any Lebesgue measurable additive function on $ \R $ must be linear, there is a full subset $ E $ of $ \R $ and functions $ g , h : E \to \R $ such that $ B ( x , y ) = g ( x ) y = x h ( y ) $ for all $ x , y \in E $. Fixing $ x _ * \in E \setminus \{ 0 \} $, for any $ x \in E \setminus \{ 0 \} $ we have $$ \frac { g ( x ) } x = \frac { h ( x _ * ) } { x _ * } = \frac { g ( x _ * ) } { x _ * } = \frac { h ( x ) } x \text . $$ Therefore, setting $ k = \frac { g ( x _ * ) } { x _ * } $, we have $ B ( x , y ) = k x y $ for all $ x , y \in E \setminus \{ 0 \} $. As $ E \setminus \{ 0 \} $ is a full subset of $ \R $, for any $ x ,y \in \R $, there are $ x _ 0 , x _ 1 , y _ 0 , y _ 1 \in E \setminus \{ 0 \} $ such that $ x = x _ 0 + x _ 1 $ and $ y = y _ 0 + y _ 1 $, for which we have $$ \begin {align*} B ( x , y ) & = B ( x _ 0 + x _ 1 , y _ 0 + y _ 1 ) \\ & = B ( x _ 0 , y _ 0 ) + B ( x _ 0 , y _ 1 ) + B ( x _ 1 , y _ 0 ) + B ( x _ 1 , y _ 1 ) \\ & = k x _ 0 y _ 0 + k x _ 0 y _ 1 + k x _ 1 y _ 0 + k x _ 1 y _ 1 \\ & = k ( x _ 0 + y _ 0 ) ( x _ 1 + y _ 1 ) \\ & = k x y \text . \end {align*} $$


Denseness of Graphs:

Let $ B : \R ^ 2 \to \R $ be biadditive and $ k = B ( 1 , 1 ) $. Given that $ B ( x _ * , y _ * ) \ne k x _ * y _ * $ for some $ x _ * , y _ * \in \R $, you can show that the graph of $ B $ is a dense subset of $ \R ^ 3 $. It's sufficient to prove this for the case $ k = 0 $; that's because defining $ \B : \R ^ 2 \to \R $ with $ \B ( x , y ) = B ( x , y ) - k x y $ for all $ x , y \in \R $, $ \B $ is biadditive, we have $ \B ( 1 , 1 ) = 0 $, and since $ ( x , y ) \mapsto k x y $ is continuous, denseness of the graph of $ \B $ in $ \R ^ 3 $ implies that of $ B $. Again, it's sufficient to prove that the graph of $ B $ is dense in the upper half-space $ \R ^ 2 \times \Rp $; that's because denseness of the graph of $ B $ in the lower half-space follows from denseness of the graph of the biadditive function $ - B $ in the upper half-space, and the union of the upper and lower half-spaces is dense in $ \R ^ 3 $. Finally, letting $ z _ * = B ( x _ * , y _ * ) $, it's sufficient to consider the case $ z _ * > k x _ * y _ * $, since if $ z _ * < k x _ * y _ * $, we have $ B ( x _ * , - y _ * ) = - z _ * > - k x _ * y _ * $, and we can replace $ y _ * $ with $ - y _ * $. So, from now on, without loss of generality, we assume that $ k = 0 $ and $ z _ * > 0 $, and only prove density of the graph of $ B $ in the upper half-space.

If $ B ( x _ * , 1 ) \ne 0 $, then defining $ A : \R \to \R $ with $ A ( x ) = B ( x , 1 ) $ for all $ x \in \R $, $ A $ will be an additive function with $ A ( 1 ) = 0 $ and $ A ( x _ * ) \ne A ( 1 ) x _ * $. Therefore, the graph of $ A $ must be dense in $ \R ^ 2 $. Hence, for any $ p \in \Q $, the graph of $ B | _ { \R \times \{ p \} } $ is dense in $ \R \times \{ p \} \times \R $. As $ \Q $ is dense in $ \R $, it follows that the graph of $ B $ is dense in $ \R ^ 3 $. Similarly, the graph of $ B $ must be dense in $ \R ^ 3 $ in case $ B ( 1 , y _ * ) \ne 0 $. So, it remains to investigate the case $ B ( x _ * , 1 ) = B ( 1 , y _ * ) = 0 $. Consider a ball in $ \R ^ 3 $ centered at $ ( x , y , z ) $ with radius $ r \in \Rp $, where $ x , y , z \in \Q $ and $ z > 0 $. Choose $ a , b , c \in \Q $ such that $ c \ne 0 $, $ \left| \frac z { z _ * } - c ^ 2 \right| < \frac r { \sqrt 3 z _ * } $, $ | x _ * - a | < \frac r { \sqrt 3 | c | } $ and $ | y _ * - b | < \frac r { \sqrt 3 | c | } $. Define $ X , Y , Z \in \R $ with $ X = x + c ( x _ * - a ) $, $ Y = y + c ( y _ * - b ) $ and $ Z = B ( X , Y ) $. Then, by bilinearity of $ B $ over $ \Q $, $$ \begin {align*} Z & = B \big( x + c ( x _ * - a ) , y + c ( y _ * - b ) \big) \\ & = { B ( x , y ) + c \big( B ( x _ * , y ) - B ( a , y ) + B ( x , y _ * ) - B ( x , b ) \big) \\ + c ^ 2 \big( B ( x _ * , y _ * ) - B ( a , y _ * ) - B ( x _ * , b ) + B ( a , b ) \big) } \\ & = c ^ 2 z _ * \text . \end {align*} $$ This implies that $ | X - x | ^ 2 + | Y - y | ^ 2 + | Z - z | ^ 2 < r ^ 2 $, and therefore we've found a point on the graph of $ B $ in the intended ball. As every ball in the upper half-space contains a ball centered at a point with rational coordinates, the result follows.

Furthermore, letting $ \Delta = \left\{ ( x , x ) \big| x \in \R ^ 2 \right\} $ (the diagonal of $ \R ^ 2 $), you can prove that if $ B ( x _ * , x _ * ) \ne k x _ * ^ 2 $, then the graph of $ B | _ \Delta $ is dense in $ \Delta \times \R $. Without loss of generality, we make all the assumptions mentioned before, and it will be sufficient to find suitable $ a , c \in \Q $ like before (given $ x _ * \in \R $ and $ x , z \in \Q $ with $ z > 0 $) and define $ X $ and $ Z $ like before, and note that this time it's like we're given $ y _ * = x _ * $ and $ y = x $, and required to let $ b = a $ so that $ Y $ becomes equal to $ X $. Without loss of generality, we can also assume that $ B $ is symmetric; that's because defining $ \B : \R ^ 2 \to \R $ with $ \B ( x , y ) = \frac { B ( x , y ) + B ( y , x ) } 2 $ for all $ x , y \in \R $, we can see that $ \B $ agrees with $ B $ on the diagonal. In particular, this means that we can assume $ B ( x _ * , 1 ) = B ( 1 , x _ * ) $, and we denote this value by $ w _ * $. We will also assume that $ x \ne 0 $, as this won't affect the denseness results.

If $ w _ * = 0 $, then choosing $ a $ and $ c $ like above (and setting $ b = a $) does the job. In case $ w _ * \ne 0 $, first note that no matter how we choose $ a $ and $ c $, we have $$ \begin {align*} Z & = B \big( x + c ( x _ * - a ) , x + c ( x _ * - a ) \big) \\ & = { B ( x , x ) + c \big( B ( x _ * , x ) - B ( a , x ) + B ( x , x _ * ) - B ( x , a ) \big) \\ + c ^ 2 \big( B ( x _ * , x _ * ) - B ( a , x _ * ) - B ( x _ * , a ) + B ( a , a ) \big) } \\ & = ( z _ * - 2 a w _ * ) c ^ 2 + 2 x w _ * c \\ & = 2 w _ * c ^ 2 ( x _ * - a ) + ( z _ * - 2 x _ * w _ * ) c ^ 2 + 2 x w _ * c \text . \end {align*} $$ If $ z _ * - 2 x _ * w _ * = 0 $, then it's sufficient to choose $ c $ and $ a $ so that $ c \ne 0 $, $ \left| \frac z { 2 x w _ * } - c \right| < \frac r { 4 \sqrt 3 | x w _ * | } $ and $ | x _ * - a | < \min \left( \frac r { \sqrt 3 | c | } , \frac r { 4 \sqrt 3 | w_ * | c ^ 2 } \right) $, and we'll have $ 2 | X - x | ^ 2 + | Z - z | ^ 2 < r ^ 2 $. In case $ z _ * - 2 x _ * w _ * \ne 0 $, let $$ d _ * = w _ * x ^ 2 + ( z _ * - 2 x _ * w _ * ) \left( z + \frac r { 2 \sqrt 3 } \right) \text , $$ and assume that $ d _ * > 0 $. It's then sufficient to choose $ c $ and $ a $ such that $ c \ne 0 $, $ \frac { x w _ * - \sqrt { d _ * } } { z _ * - 2 x _ * w _ * } < c < \frac { x w _ * + \sqrt { d _ * } } { z _ * - 2 x _ * w _ * } $ and $ | x _ * - a | < \min \left( \frac r { \sqrt 3 | c | } , \frac r { 4 \sqrt 3 | w_ * | c ^ 2 } \right) $. This will prove denseness of the graph of $ B | _ \Delta $ in a subregion of $ \Delta\times \R $ described with $ d _ * ( x , z ) > 0 $, when $ x $ and $ z $ are seen as real variables. Now, note that we can argue the same starting with the point $ q x _ * $ instead of $ x _ * $, where $ q \in \Q $ and $ q $ has the same sign as $ w _ * $. Then we will have $ B ( q x _ * , q x _ * ) = q ^ 2 z _ * $ and $ B ( q x _ * , 1 ) = q w _ * $, and we will end up proving denseness of the graph of $ B | _ \Delta $ in the subregion of $ \Delta \times \R $ described with $$ q w _ * x ^ 2 + q ^ 2 ( z _ * - 2 x _ * w _ * ) \left( z + \frac r { 2 \sqrt 3 } \right) > 0 \text , $$ or equivalently $$ x ^ 2 + q \left( \frac { z _ * } { w _ * } - 2 x _ * \right) \left( z + \frac r { 2 \sqrt 3 } \right) > 0 \text . $$ As we can take $ q $ as small as we want, this means that we have the result for $ x ^ 2 > 0 $, or equivalently $ x \ne 0 $.