What is wrong with my approach in this problem? Find all functions $f$ such that $f(x + y)f(x − y) = (f(x) + f(y))^2 − 4x^2 f(y)$ for real $x$, $y$ Problem:

Find all functions $f : R → R$ such that
$$f(x + y)f(x − y) =
(f(x) + f(y))^2
− 4x^2
f(y)$$
for all $x, y ∈ R$, where R denotes the set of all real numbers.

My approach: I substituted $x=y=0$ which gave $f(0)=0$. I then substituted $x=y=t$ which gave $f(2t)f(0) = 4f(t)(f(t)-t^2) => f(t) = 0, f(t) = t^2 $. Thus the only solutions are $f(x)= 0$ and $f(x) = x^2$.
But this is an olympiad problem (INMO 2011, India). So, there must be something more complicated than this that I am probably missing. My answer matches but the proof given in the official solution is quite long. Here
 A: Your deduction revealing that for each $x$ either $f(x)=0$ or $f(x)=x^2$ is correct. What you are missing is that there are still infinitely many functions remaining. You may have $f(1)=1$ or $f(1)=0$, you may have $f(2)=4$ or $f(2)=0$. That's four combinations already. Are all the alternatives possible? You haven't even touched that question, yet.
A: As @Jyrki Lahtonen and others pointed out, you cannot conclude $f(x)\equiv 0$ or $f(x)\equiv x^2$ in the current step. But a few more observations can lead you to the desired conclusion. Assume $t\ne 0$ and $f(t)=0$. Then we have
$$
f(x+t)f(x-t) = f(x)^2,\quad\forall x\in\Bbb R.
$$ Suppose $f(-t) = (-t)^2=t^2$. Then we also have
$$
f(x-t)f(x+t)=f(x)^2+2t^2 f(x) +t^4-4x^2t^2.
$$ Thus it holds
$$
f(x) = 2x^2-\frac{t^2}{2},\quad\forall x\in\Bbb R.
$$ But we can choose $x$ such that $2x^2-\frac{t^2}{2}\ne 0$ and $2x^2-\frac{t^2}{2}\ne x^2$. This leads to a contradiction.
From this, we know that $f(t)=0$ implies $f(-t)=0$. This means either $f(t)=f(-t)=0$ or $f(t)=f(-t)=t^2$ for all $t\ne 0$. So $f$ is an even function. Now we interchange $x$ and $y$ in the original functional equation. Then we get
$$
f(x+y)f(y-x)=(f(x) + f(y))^2
− 4y^2
f(x).
$$ Since $f(y-x)=f(x-y)$, we have
$$
4x^2f(y)=4y^2f(x),
$$ and for $x\ne 0$, $y\ne 0$,
$$
\frac{f(x)}{x^2}=\frac{f(y)}{y^2}=\text{constant}.
$$ Thus, we conclude that if there exists $t_0\ne 0$ such that $f(t_0)=0$, then $f(t)\equiv 0$, and otherwise $f(t)\equiv t^2$.
