Problem about functional equations: $ f \left( x ^ 2 + y \right) = f ( x ) ^ 2 + \frac { f ( x y ) } { f ( x ) } $ This problem was taken from the Bulgarian selection team test for the 47th IMO and appeared in a Chinese magazine, I came across it in my own training.
http://www.math.ust.hk/excalibur/v10_n4.pdf
The problem is as follows:

Consider $ f : \mathbb R ^ * \to \mathbb R ^ * $ where $ \mathbb R ^ * $ is the set of non-zero real numbers. Find all such functions that satisfy the following functional equation for all $ x $ and $ y $ in $ \mathbb R ^ * $ with $ y \ne - x ^ 2$:
$$ f \left( x ^ 2 + y \right) = f ( x ) ^ 2 + \frac { f ( x y ) } { f ( x ) } $$

I suspect the only function is the identity, but the problem has proved itself to be too difficult for me, I've pondered about it for various hours. Any hint or solution is welcome! Thanks.
 A: This might not be the optimal approach... but it attempts to avoid reasoning based on real analysis (well, apart from the very definition of irrational numbers).
Determine the value of $f(1)$
Let $f(1)=A$. Then, for any $y$ different from $0$ and $(-1)$ we have $$f(1+y)=f(1)^2 + f(y)/f(1) = A^2 + f(y)/A$$ which allows us to express the following quantities: $$\begin{eqnarray}
f(2) & = & A^2 + 1 \\
f(3) & = & A^2 + A + \frac{1}{A} \\
f(4) & = & A^2 + A + 1 + \frac{1}{A^2} \\
f(5) & = & A^2 + A + 1 + \frac{1}{A} + \frac{1}{A^3} \\
\end{eqnarray}$$
At the same time, we have $f(x^2+1)=f(x)^2+f(x)/f(x)=f(x)^2+1$. This gives us $$f(5)=f(2)^2+1$$ Equating the two expressions for $f(5)$ and substituting for $f(2)$ gives us
$$(A^2+1)^2 + 1 = A^2+A+1+\frac{1}{A} + \frac{1}{A^3}$$ which simplifies to $$\begin{eqnarray}0 & = & A^7 + A^5 - A^4 + A^3 - A^2 - 1 \\ & = & (A-1)(A^2-A+1)(A^2+A+1)^2\end{eqnarray}$$ whose only real root is $A=1$. Thus, $f(1)=1$ and we have $f(1+y)=1+f(y)$ for all $y$ other than $0$ and $(-1)$. In particular, this means that $f(k)=k$ for any positive integer $k$.
Show additive property for numbers of same sign
Now, consider real numbers $u,v$ of the same sign and these two equalities:
$$\begin{eqnarray}
f(v^2 + u/v) & = & f(v)^2 + f(u)/f(v) \\
f(v^2 + (u/v + 1)) & = & f(v)^2 + f(u+v)/f(v) \\
\end{eqnarray}$$
We can apply the equality $f(1+y)=1+f(y)$ since both $v^2$ and $u/v$ are positive to obtain 
$$f(u+v)=f(u)+f(v)$$
Note: This equation is very similar to Cauchy's functional equation; a quite interesting problem of its own. The equality given in our problem is stronger than "just" plain additivity, though.
Determine values of $f$ on positive rationals
It's quite easy to see that this equality implies that $f\left(\frac{p}{q}\right)=\frac{p}{q}$ for any positive integers $p,q$; one simply expands $$p=f(p)=f\left(\frac{p}{q}\right)+f\left(\frac{p}{q}\right)+\ldots+f\left(\frac{p}{q}\right)=q\cdot f\left(\frac{p}{q}\right)$$
Show that $f$ is increasing on positive reals
For $y>0$, we can write $$\begin{eqnarray}
f(y) = f(y)+1-1 & = & f(y+1)-1 \\
& = & f\left((\sqrt{y})^2+1\right)-1 = \\
& = & f\left(\sqrt{y}\right)^2+1-1 \\
& = & f\left(\sqrt{y}\right)^2>0
\end{eqnarray}$$
Thus, for any positive reals $u>v>0$, we get $$f(u)=f(v+(u-v))=f(v)+f(u-v)>f(v)$$
Determine the values of $f$ for positive reals
Let's show that $f(x)=x$ for $x>0$. If that wasn't the case, we'd have either $f(x)>x$ or $0<f(x)<x$. In the first case, we could find rational number $z$ with $f(x)>z>x$. First inequality implies $f(x)>f(z)$ since $f(z)=z$, while the second one implies $f(z)>f(x)$, a contradiction. The other case can be treated in the same way. Thus, $f(x)=x$.
Alternate approach is to realize that the Dedekind cut corresponding to irrational $x>0$ must be the same as the Dedekind cut corresponding to $f(x)$.
Finish the proof by considering the negative reals
If $x<0$ is non-integer, we can simply use the equality $f(1+y)=1+f(y)$ to show that $f(x)=x$; just by adding $1$ until we reach a positive number. For negative integers, we can bootstrap the process by considering $f(-1)=f\left(-\frac{1}{2}\right)+f\left(-\frac{1}{2}\right)=(-1)$ and do the same by reaching $(-1)$.
The only function satisfying the given condition is $f(x)=x$ Q.E.D.
A: $\newcommand{\NN}{{\mathbb{N}}}\newcommand{\CC}{{\mathbb{C}}}\newcommand{\RR}{{\mathbb{R}}}\newcommand{\QQ}{{\mathbb Q}}\newcommand{\ra}{\rightarrow}\newcommand{\ds}{\displaystyle}\newcommand{\mat}[1]{\left(\begin{matrix}#1\end{matrix}\right)}\newcommand{\lam}{\lambda}\renewcommand{\P}{{\mathcal P}}\newcommand{\N}{{\mathcal N}}\newcommand{\M}{{\mathcal M}}\renewcommand{\L}{{\mathcal L}}\newcommand{\EQ}[2]{\begin{equation} {{#2}\label{#1}} \end{equation}}\newcommand{\eps}{\varepsilon}$
It contains numerous elements that are also in other answers - I put it anyway.
Observe that $f$ cannot be constant, because the equation $C=C^2+1$ has no real solution.
Putting $y=1$, we find that  $f(x)^2+1=f(x^2+1)=f(-x)^2+1$ and hence $f(x)^2=f(-x)^2$ 
for all $x\in A$. Putting $x=\pm1$, we obtain $f(-y)/f(-1)=f(y)/f(1)$ for all $y$. So either
$f(-x)=f(x)$ for all $x$ or $f(-x)=-f(x)$ for all $x$.
The solution $y$ of $x^2+y=xy$ is $y=\frac{x^2}{x-1}$ unless $x=1$. Using this $y$ we have
$$f\left(\frac{x^3}{x-1}\right)=\frac{f(x)^3}{f(x)-1}\mbox{ for }x\neq1.$$
Consider now a solution $z$ of $\frac{z^2}{z-1}=-1$. Then $f(-z)=\frac{f(z)^3}{f(z)-1}$.
As a consequence $f(-z)$ cannot equal $f(z)$ because $1=\frac{f(z)^2}{f(z)-1}$ has no real
solution for $f(z)$. Hence $f(-z)=-f(z)$ and, as seen above, $f(-x)=-f(x)$ for all $x.$
Next consider $x=1$ and replace $y$ by $-y$. We find $f(1-y)=f(1)^2-\frac{f(y)}{f(1)}$
for $y\neq1$. Replacing here $y$ by $1-y$ yields with $w=f(1)$
$$w^2f(y)=w^4-wf(1-y)=w^4-w^3+f(y)\mbox{ for all }y\in A,y\neq1.$$
Thus $(w^2-1)f(y)=w^4-w^3$. So we must have $w=1$ as otherwise $w=-1$ 
which leads to a contradiction or $f(y)=\frac{w^3}{w+1}$ is constant which had been excluded.
So finally we proved that $w=f(1)=1$.
Putting $x=1$ now gives $f(y+1)=f(y)+1$ for $y\neq-1$. In particular, we find $f(n)=n$ and
$f(-n)=-n$ for all positive integers $n$. Putting $x=n$, we obtain
$f(y+n^2)=n^2+\frac1nf(ny)$ for all $y\neq-n^2$ and $f(ny)=nf(y)$ for all positive $y$
(In fact, we only have to exclude that $y$ is a negative integer).
In particular this leads to $f(q)=q$ for all rational positive $q$. It is extended to
negative rationals using $f(-x)=-f(x)$.
Moreover, we obtain $f(y+m)=f(y)+m$ for all non-integer $y$ and thus
$f(y+\frac mn)=\frac1nf(ny+m)=\frac1n(nf(y)+m)=f(y)+\frac mn$ 
for all irrational $y$ and hence $f(y+q)=f(y)+q$
for all rational $q$ and irrational $y$.
Finally, as $f(x^2+1)=f(x)^2+1$ and hence $f(x^2)=f(x)^2$ for all $x$,
the values of $f$ for positive $y$ are positive and hence also its values for 
negative $y$ are negative.
Given any irrational $y$, we consider rational $q,r$ with $q<y<r$. Then
as $y-q>0$, we have $f(y)-q=f(y-q)>0$ and hence $q<f(y)$. In the same way we show that
$f(y)<r$. Since we can use any rational $q,r$ with $q<y<r$, 
we have shown that $f(y)=y$ also for irrational $y$.
