find all continuous functions $f:\mathbb{R}^n \rightarrow \mathbb{R}$ satisfying \begin{equation*} f(x+y)+f(x-y)=2f(x)+2f(y)~\forall x,y \in \mathbb{R}^n. \end{equation*} My attempt: I manage to show that for any $q \in \mathbb{Q}$, $f(qx)=q^2f(x)$ for all $x \in \mathbb{R}^n$. I have a feeling that the answer is $f(x)=A\| x \|^2$, but I'm unable to prove it.
Can anyone give some hint?
YES, $f$ must be a quadratic homogeneous polynomial (QHP in abbreviated notation) as you expected.
We have a continuous function $f:\mathbb{R}^n \rightarrow \mathbb{R}$ satisfying $$ f(x+y)+f(x-y)=2f(x)+2f(y)~\forall x,y \in \mathbb{R}^n \tag{1} $$
Let $a,b\in{\mathbb R}^n$. For $k\in{\mathbb N}$, define $\phi_{a,b}(k)=f(a+kb)$. Taking $x=a+(k+1)b$ and $y=b$ in (1) above, we see that $\phi_{a,b}$ satisfies a second-order linear recurrence formula :
$$ \phi_{a,b}(k+2)-2\phi_{a,b}(k+1)+\phi_{a,b}(k)=2f(b) \tag{2} $$
It follows easily from (2), by induction on $k\in{\mathbb N}$ that
$$ \phi_{a,b}(k)=k\phi_{a,b}(1)-(k-1)\phi_{a,b}(0)+k(k-1)f(b) \tag{3} $$
Note that (3) can be rewritten as (putting $\mu=k$)
$$ f(a+\mu b)=f(a)+\mu(f(a+b)-f(a)-f(b))+\mu^2f(b) \ (\mu\in{\mathbb N}) \tag{3'} $$
Now, let $\lambda,\mu\in{\mathbb N}$. We have \begin{equation} \begin{split} f(\lambda a+\mu b) &= f(\lambda a)+\mu\Bigg(f(\lambda a+b)-f(\lambda a)-f(b)\Bigg)+\mu^2f(b) \\ &= \lambda ^2 f(a)+\mu\Bigg(\Bigg[f(b+\lambda a)\Bigg]-\lambda^2 f(a)-f(b)\Bigg)+\mu^2f(b) \\ &= \lambda ^2 f(a)+\mu\Bigg(\Bigg[f(b)+\lambda(f(a+b)-f(a)-f(b))+\lambda^2 f(a)\Bigg] -\lambda^2 f(a)-f(b)\Bigg)+\mu^2f(b) \\ &= \lambda ^2 f(a)+\lambda\mu\Bigg(f(a+b)-f(a)-f(b)\Bigg)+\mu^2f(b) \ \ \ \ \ \ \ \ \ \ \ \ \ (4) \\ \end{split} \end{equation}
Replacing $a$ or $b$ with their opposites, we see that (4) still holds when $\lambda$ or $\mu$ is negative. By homogeneity, (4) still holds when $\lambda,\mu\in{\mathbb Q}$. By continuity, (4) still holds when $\lambda,\mu\in{\mathbb R}$. So the restriction of $f$ to any two-dimensional subspace is a QHP.
As a special case of (4), we have for $x,a\in{\mathbb R}^n$ and $\lambda \in {\mathbb R}$,
$$ f(x+\lambda a)=f(x)+\lambda (f(x+a)-f(x)-f(a)) +\lambda^2 f(a) \tag{5} $$
Viewing $x+\lambda a+\lambda a'$ as $(x+\lambda a)+\lambda' a'$ and using (5) repeatedly, we obtain for $x,a,a'\in{\mathbb R}^n$ and $\lambda,\lambda' \in {\mathbb R}$
$$ \begin{array}{lcl} f(x+\lambda a+\lambda' a') &=& f(x)+(\lambda+\lambda')(f(x+a)-f(x)-f(a))+\\ & & \lambda \lambda' (f(x+a+a')-f(x+a)-f(x+a')+f(x)) +\\ & & \lambda^2f(a)+{\lambda'}^2f(a') \tag{6} \end{array} $$
Replacing $x$ with $\lambda''a''$ in (6) above and using (5) repeatedly one more time, we obtain for $a,a',a''\in{\mathbb R}^n$ and $\lambda,\lambda',\lambda'' \in {\mathbb R}$,
$$ \begin{array}{lcl} f(\lambda a+\lambda' a'+\lambda''a'')&=& \lambda \lambda' (f(a+a')-f(a)-f(a')) + \\ & &\lambda \lambda'' (f(a+a'')-f(a)-f(a'')) + \\ & & \lambda' \lambda'' (f(a'+a'')-f(a')-f(a'')) + \\ & & \lambda^2f(a)+{\lambda'}^2f(a')+{\lambda''}^2f(a'') + \\ & & \lambda\lambda'\lambda''(f(a+a'+a'')-f(a+a')-f(a+a'')-f(a'+a'')+f(a)+f(a')+f(a'')) \\\tag{7} \end{array} $$
Note that when $\lambda=\lambda'=\lambda''=t$, the LHS reduces to $t^2f(a+a'+a'')$ which has no $t^3$ term. So in (7) above the $\lambda\lambda'\lambda''$-coefficient must be zero. Then (7) shows that the restriction of $f$ to any three-dimensional subspace is a QHP. If we put $B(a,b)=f(a+b)-f(a)-f(b)$, it follows that for any $a$, $B(a,.)$ is linear on any two-dimensional subspace, and hence linear everywhere. So $B$ is bilinear, which concludes the proof.