Finishing the solution to this functional equation: $ f\left(x^2+y\right)=f\bigl(f(x)-y\bigr) + 4f(x)y $ I am trying to solve the below functional equation for $f$ (where $f: \mathbb{R} \to \mathbb{R}$):
$$ f\left(x^2+y\right)=f\bigl(f(x)-y\bigr) + 4f(x)y \text. $$
(Source: https://web.evanchen.cc/handouts/FuncEq-Intro/FuncEq-Intro.pdf: "Iran TST 1996")
Here's what I've got so far:
Substituting $y=0$ we have $f\left(x^2\right) = f\bigl(f(x)\bigr)$.
Substituting $y=f(x)$ we have
$$f\left(x^2+f(x)\right) = f(0) + 4f(x)^2 \text.$$
$$f(0) = 0 \text. $$
Letting $x=0$ we can show the function is even.
Finally letting $y = -x^2$ we can simplify to yield
$$f(x) \left(x^2 - f(x)\right) = 0 \text. $$
And this is where I'm stuck. Given that it's an Olympiad I'm fairly sure that actually the only solutions are $f(x) = x^2$ and $f$ is identically zero and that there will not be any pathological solutions that have discontinuities - though I have not been able to show this.
My ideas that I've tried:

*

*Showing $f$ is injective when not identically zero (on $\mathbb{R}^+$ that is), this doesn't seem to go anywhere useful.

*Showing that $f$ is surjective (again onto $\mathbb{R}^+$) when not identically zero, as if that is the case we always must choose $x^2$ instead of zero other we miss out a positive number. However I haven't been able to find any way to show this either.

*Use inequalities to show that if $f$ is not identically zero then the inequality $f(x) \ge 0$ that we have from our current information (either $f$ is zero or the square of a real) is strict when $x \ne 0$, but again I couldn't do anything with this either.

 A: We know that for each $x\in\mathbb R$, either $f(x)=x^2$ or $f(x)=0$.
Let $A=\{x\neq0\mid f(x)=0\}$ and $B=\{x\neq0\mid f(x)=x^2\}$. Then $A$, $B$ partition $\mathbb R\setminus\{0\}$.
Suppose both are non-empty. Take $a\in A$ and $b\in B$. Sub $x=a,y=-b$ to get $f(a^2-b)=b^2$. Since $b\neq0$, we must have $b^2=(a^2-b)^2\implies a^2=2b$ (as $a\neq0$).
This implies $\lvert A\rvert\leq2$ and $\lvert B\rvert=1$, a clear contradiction. So one of $A$, $B$ is empty, and we recover the two solutions.
A: Here's another way to avoid the point-wise trap:
Let $P(x,y)$ denote the given assertion, suppose there exist $a,b\ne 0$ such that $f(a)=0, f(b)=b^2$, then $$P(a,-x) : f(a^2+x)=f(-x)=f(x)$$ so $a^2$ is a period of the function $f$. However, we also have $$P(b,a^2) : f(b^2+a^2)=f(b^2-a^2)+4a^2b^2=f(b^2+a^2)+4a^2b^2 \implies 4a^2b^2=0$$ which means either $a=0$ or $b=0$ which is impossible. So, this means that $f(x)\equiv x^2$ and $f\equiv 0$.
A: Hint Take
\begin{equation}
y = \frac{f(x)-x^2}{2}
\end{equation}
This leads to $\forall x, f(x)\in \{0, x^2\}$, hence we can write $f(x) = x^21_x$ where $\forall x\in{\mathbb R}, 1_x\in\{0,1\}$. Let us rewrite the functional equation as
\begin{equation}
y^2(1_{x^2+y}-1_{x^2 1_x - y})+2x^2 y(1_{x^2+y}+1_{x^2 1_x-y}-2. 1_x)
+ x^4(1_{x^2+y}-1_{x^2 1_x-y}) = 0
\end{equation}
This equation must be satisfied for all $x, y$ but the coefficient of $y^2$ here can be only $-1,0 ,1$, the coefficient of $2x^2 y$  can be only $-2, -1, 0, 1, 2$ and the coefficient of $x^4$ can be only $-1,0,1$.
Let $x$ be given such that $x\not=0$ and $1_x=1$ (or equivalently $f(x) = x^2\not=0$). Clearly the coefficients of $y^2$ and $y$ can be non zero for at most a finite number of $y$'s because in this case, $y$ must be a solution of a polynomial equation of degree 1 or 2 chosen among 44 such non trivial equations. It follows that for all $y$ but a finite number of them one has
\begin{equation}
1_{x^2+y} = 1_{x^2 1_x-y} = 1
\end{equation}
Hence $1_z = 1$ for all $z\in{\mathbb R}$ except on a finite set and $f(z) = z^2$ except perhaps on this finite set.
