Peter wrote:
Find all functions $f: \mathbb{Q}^{+}\to \mathbb{Q}^{+}$ such that for all $x,y \in \mathbb{Q}$: \[f \left( x+\frac{y}{x}\right) =f(x)+\frac{f(y)}{f(x)}+2y, \; x,y \in \mathbb{Q}^{+}.\]
Setting $x=y$ in the equation we get that
\[f(x+1)=f(x)+2x+1\]
therefore $f(x+m)=f(x+m-1)+2(x+m)-1$. Adding up those equations for
all $m=1,2,...,n$ we get that $f(x+n)=f(x)+2xn+n^{2}$. Setting in the
latter $x=1$ we get that $f(n+1)=(n+1)^{2}+(f(1)-1)$.
Returning to the initial equation and setting $x=1$ we get
$f(y+1)=f(1)+\frac{f(y)}{f(1)}+2y$ but we also know that
$f(y+1)=f(y)+2y+1$ $\Rightarrow$ $f(1)=1$ $\Rightarrow$ $f(n)=n^{2}$ for all $n\in{N}$.
Again let's go back to the initial equation and set there $x=n\in{N}$ and
$y=m\in{N}$. We get that $f(n+\frac{m}{n})=f(n)+\frac{f(m)}{f(n)}+2m$. Meanwhile $f(n+\frac{m}{n})=f(\frac{m}{n})+2n(\frac{m}{n})+n^{2}$ $\Rightarrow$
\[f(\frac{m}{n})=\frac{f(m)}{f(n)}=\frac{m^{2}}{n^{2}}\]
$\Rightarrow$
\[f(x)=x^{2}\]
for all $x\in{Q^{+}}$.