Functional Equation (no. of solutions): $f(x+y) + f(x-y) = 2f(x) + 2f(y)$
Solution 1:
$f(0)=0$ By choosing $x=y=0$. Also by choosing $x=y$ we can see $f(2x)=4f(x)$. Moreover choose $x=0$ and use $f(0)=0$, then you have $f(y)=f(-y)$.
Now by strong induction one can prove that $f(nx)=n^2f(x)$.
Then choose $x$ as $\frac{x}{n}$ in preceding equation, then you get: $$ f(x)={n^2}f(\frac{x}{n})\rightarrow\frac{1}{n^2}f(x)=f(\frac{x}{n}) $$ And finally we have: $$ f(\frac{mx}{n})=\frac{1}{n^2}f(mx)=\frac{m^2}{n^2}f(x). $$ Now assume that $f(1)=a$ for some $a\in\mathbb{R}$, then you get $$ f(x)=ax^2 $$ for all rational $x=\frac{m}{n}$.
Solution 2:
That equation, which is often called Appolonius' formula or the parallelogram law, is a characterization of homogeneous quadratic forms on a vector space (without solutions of $v+v=0$).
In plane geometry, with $f(\mathbb{x})=|\mathbb{x}|^2$ the squared Pythagorean distance, the formula is the relation proved by Appolonius between the diagonals and sides of a parallelogram. In a vector space, for any dot product [symmetric bilinear form] $B$, the associated 'squared distance' function [the restriction to a quadratic form] $f(x)=B(x,x)$ satisfies the equation, due to
$B(x+y,x+y)=B(x,x) + B(y,y) + 2B(x,y)$.
Conversely, any solution of the equation comes from this construction, and $2B(x,y) = f(x+y) - f(x) - f(y) $ . The posted problem is the case of a 1-dimensional vector space over the field of rational numbers.