Prove that $f$ is additive if $f(x)f(x-y)+f(y)f(x+y)= f(x)^2+f(y)^2$ 
Say $f:\mathbb{R}\to \mathbb{R}$ is non-constant such that $$f(x)f(x-y)+f(y)f(x+y)= f(x)^2+f(y)^2$$
  Prove that $f(x+y)=f(x)+f(y)$. 


If we put $a=f(0)$ and $y=0$ we get $$f(x)^2+af(x)= f(x)^2+a^2 \implies af(x) = a^2$$
If $a\ne 0$ then $f(x)=a$ is constant function which can not be, so $a=0$. Now if we put $x=y$ we get $$f(x)f(2x)=2f(x)^2$$
From here I have no more idea what to do. 

Edit after Lulu's comment: If we put also $y=-x$ we get $$2f(x)^2= f(x)f(2x) = f(x)^2+f(-x)^2\implies \boxed{f(x)^2=f(-x)^2}$$
 A: Clearly any constant solution is the zero function. So assume that $f$ is nonzero. Let $P(x,y)$ denote the given assertion. We have $f(0)=0$ by $P(x,0)$. Take $f(x)\neq 0$, then $P(x,x)$ implies $f(2x)=2f(x)$ and following an easy induction $f(kx)=kf(x)$ for all $k\in \mathbb N.$ If $f(x_0)=0$ then $P(x_0,-x_0)$ gives $f(-x_0)=0.$ So for all $x,$ $f$ is odd. Now $P(x,-y)$ and $P(x,y)$ implies $$f(x-y)(f(x)+f(y))=f(x+y)(f(x)-f(y)).$$ If $f(x)+f(y)\neq 0$ then substituting value of $f(x-y)$ in original equation gives $f$ is additive. If $f(x)+f(y)=0$ but $f(x+y)\neq 0$, then $f(x)=f(y)=0,$ and so $P(x+y,y)$ gives $f(x+y)=0,$ absurd.
A: This is only part of an answer, as I can't prove that $f$ is even or odd.
First, we want to show that $f$ is either even or odd, given $f(x)^2 = f(-x)^2$.
Say there are two points $x$ and $y$ such that $f(x) = f(-x)$ and $f(y) = -f(-y)$. Then, $f(x)f(x-y) + f(x+y) = f(x)^2+f(y)^2$, and, by plugging in $-x,y$, we get $$f(-x)f(-x-y) + f(y)f(y-x) = f(-x)^2 + f(y)^2 = f(x)^2 + f(y^2)$$ so we have $$f(x)f(-x-y) + f(y)f(y-x) = f(x)f(x-y) + f(y)f(x+y)$$

We now take cases on if $x+y$ and $y-x$ are odd or even. 
If they are both even, then we have $f(x+y) = f(x-y)$ or $f(x) = f(y)$ by factorization, which is constant. If they are both odd, Then $f(x) = -f(y)$ or $f(x+y) = f(x-y)$, which still both are contradictions.
Therefore, one has to be even and one has to be odd. I don't see any way to continue from here; so I skip to the part where they are either even or odd.

Now, we show that $f(x)$ is odd.
We know that $f(x)f(x−y)+f(y)f(x+y)=f(x)^2+f(y)^2$, and by plugging in $-y$ in for $y$, we get $f(x)f(x+y) + f(y)f(x-y) = f(x)^2 + f(-y)^2 = f(x)^2 + f(y)^2$, since $f(-y)^2 = f(y)^2$ and therefore $$f(x)(f(x+y)-f(x-y)) = f(y)f(x+y) - f(-y)f(x-y)$$
Now, we know that $f$ is either odd or even (or assume it for now). However, if $f$ is even, then we have $$f(x)(f(x+y)-f(x-y)) = f(y)(f(x+y) - f(x-y))$$ So either $f(x) = f(y)$, contradiction, or $f(x+y) - f(x-y) = 0 \implies f(x+y) = f(x-y)$, and because $x+y$ and $x-y$ can range all real numbers, which is also a contradiction.

Now, if $f(x+y)$ is not $f(x)+f(y)$, then $f(x-y) \neq f(x) - f(y)$, and by replacing $x$ with $y$, we get $f(y-x) \neq f(y) - f(x)$, so $f(x-y)+f(y-x) \neq 0$, which is a contradiction of the fact that $f$ is odd.
A: The OP already showed  $f(0)=0$ and $f(x)^2=f(-x)^2$.
Let $G=f^{-1}(0)$. Then we already know $0\in G$ and $x\in G\to -x\in G$.Assume $a,b\in G$. Then
$$\tag{$a+b,b $} 0+0=f(a+b)^2+0$$
and so $a+b\in G$. We conclude that $G$ is a subgroup of $\Bbb R$.
From
$$\tag{$x,x$}f(x)f(2x)=2f(x)^2,$$
we see that $2x\in G\to x\in G$ and also conclude (as we already know $f(x)=0\to f(2x)=0$)
$$ f(2x)=2f(x).$$
Next, from
$$\tag{$x,2x$} f(x)f(-x)+f(2x)f(3x)=f(x)^2+f(2x)^2$$
we see
$$ f(-x)+2f(3x)=5f(x).$$
And from 
$$\tag{$x,-2x $}f(x)f(3x)+f(-2x)f(-x)=f(x)^2+f(-2x)^2$$
we see (as $f(-2x)=\pm f(2x)$)
$$ f(3x)\pm2f(-x)=5f(x).$$
Then $f(-x)\mp 4f(-x)=-5f(x)$ together with $|f(-x)|=|f(x)|$ shows that (for $f(x)\ne0$, but trivially also for $f(x)=0$) the lower sign must hold, and consequently, 
$$ f(-x)=-f(x).$$
Now from $$\tag{$y,-x$} f(y)f(x+y)+f(x)f(x-y)=f(x)^2+f(y)^2$$
and the original functional equation, we find that either the obvious solution $f(x\pm y)=f(x)\pm f(y)$ is the unique solution of these two linear equations in the unknowns $f(x+y)$, $ f(x-y)$; or the discriminant is zero, i.e., $f(x)=f(y)$.
So all we still need to show additivity for, is the case that $f(x)=f(y)$. We already know from above that $f(x+y)=f(x)+f(y)$ when $f(x)=f(y)=0$. Therefore we may assume that $f(2x)=2f(x)\ne f(y)$ and so $f(2x+y)=f(2x)+f(y)=3f(x)\ne f(-x)$ and ultimately $f(x+y)=f((2x+y)-x)=f(2x+y)+f(-x)=2f(x)$, as desired.
