Is my proof correct??? The following question was asked in INMO 2005:
"Find all functions $f:\Bbb{R} \rightarrow \Bbb{R} $ such that 
$$f(x^2 + yf(z)) = xf(x) + zf(y)$$
for all $x,y,z \in \Bbb{R}$.
I am thinking of this as a solution:
"Put $x = y = 0 $ in the given equation, I get $$f(0) = zf(0)$$ for all $z$ in $R$ which means that $f(0) = 0$
Further take $y=0$ in the original equation to give me $$f(x^2)=xf(x)$$
Put $x = 0$ in the original equation to give $$f(yf(z)) = zf(y) *$$ 
In the above equation put $z=1$ to give $$f(yf(1)) = f(y)$$
Let $f(1) = c$ ,which gives me $f(cy) = f(y) **$
In the equation marked * put $y = 1$ to give $$f(f(z)) = zc$$
Taking $f$ on both sides gives $f(f(f(z))) = f(zc) = f(z)$ from **
Let $f(z) = x$ , say then I get $f(f(x)) = x$, but I know that $f(f(x)) = xc$ which means that $$c=1$$
Not put $z = 1$ and since $xf(x) = f(x^2)$ I get $$f(x^2 + y) = f(x^2) + f(y)$$ Now I replace x^2 by x to get $$f(x + y) = f(x) + f(y)$$ to give me the cauchy equation with solns $f(x) = 0$ for all x or $f(x) = x$(from f(1) = 1)
Now though I have given the solutions, there are two pints where I doubt my solution a little. They are when I replace$f(z)$ by some $x$. Is this step valid? And the other doubt is when I replace $x^2$ by $x$. Are these two steps valid and are there any errors in this solution?
Thanks in advance
 A: As @Kavi Rama Murthy pointed out, substitution $f(z) \mapsto x$ is only for $x$ in the range of $f$. However, if we assume that $f$ is not the trivial solution $0$, there is $x'\neq 0$ such that
$$f(f(x')) = x'.$$ Since $f(f(x)) = cx$ for all real $x$, we have $c=1$ and it follows
$$
f(f(x)) = x,\quad \forall x\in\mathbb{R}.
$$ Secondly, $x^2\mapsto x$ is only for non-negative $x$. Hence we get
$$
f(x+y) =f(x) +f(y) ,\quad x\geq 0, y\in \mathbb{R}.\tag{*}
$$ If one of $x,y$ is non-negative, $f(x+y) = f(x)+f(y)$ holds. If both are negative, we may use 
$$
f(x^2) = xf(x) = f((-x)^2) = -xf(-x),\quad\forall x.
$$ Since $f$ is odd, $(*)$ holds for every real.
Finally, we obtained Cauchy's equation $(*)$. However, we can find non-continuous solution of $(*)$ using Hamel $\mathbb{Q}$-basis of $\mathbb{R}$. That is, $(*)$ does not necessarily lead to $f(x) = x$ (non-trivial solution.) To prove $f(x) = x$, let $F$ denote the set of all reals $x$ such that $x=f(x)$. We can see that $(i)$ $F$ is closed under addition, subtraction and multiplication, $(ii)$ $x^2 \in F$ implies $\pm x\in F$. Proof of $(i)$ is quite straightforward if we notice that $f(zf(y))=yf(z)$. Proof of $(ii)$ uses the identity $f(x^2) = xf(x)$. Now, we are ready to prove $F=\mathbb{R}.$ Note that
$$
f(x+f(x)) = f(x) +f(f(x)) = x+f(x),
$$and
$$
f(x-f(x)) = f(x) +f(-f(x)) = f(x) -f(f(x)) = f(x) - x.
$$ Let $k= x-f(x)$. By $(ii)$, we have $k\in F$ if $k^2 = x^2 + f(x)^2 -2xf(x)\in F$. Note that $$ x+f(x)\in F \Rightarrow (x+f(x))^2 \in F,$$
and that
$$ f(xf(x)) =xf(x) \Rightarrow xf(x) \in F.$$
These two facts show that $k^2 = (x+f(x))^2-4xf(x)\in F$ and hence we get $k\in F$.
Finally, from
$
f(k) = -k = k,
$ we get $x-f(x) = 0$ for all reals $x$ as desired.
A: $$f\left ( x^2+yf\left ( z \right ) \right )=xf\left ( x \right )+zf\left ( y \right )$$
$$y=0\Rightarrow f\left ( x^2 \right )=xf\left ( x \right )$$
$$x=0\Rightarrow f\left ( yf\left ( z \right ) \right )=zf\left ( y \right )$$
$$y=1\Rightarrow f\left ( f\left ( z \right ) \right )=zf\left ( 1 \right ),\forall x\in \mathbb{R}$$
$$f\left ( x\left ( f\left ( x \right ) \right ) \right )=f\left ( f\left ( x^2 \right ) \right )=x^2f\left ( 1 \right )$$
$$y=x=z\Rightarrow f\left ( xf\left ( x \right ) \right )=xf\left ( x \right )$$
$$x^2f\left ( 1 \right )=xf\left ( x \right )\Rightarrow f\left ( x \right )=cx,x\neq 0$$
$$c^2yz=cyz,\forall y,z\in \mathbb{R}\Rightarrow c=\left \{ 0;1 \right \}$$
$$f\left ( x \right )=0 \wedge f\left ( x \right )=x$$
