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.