Problem 2. Find all functions $f: \mathbb{R} \rightarrow \mathbb{R}$ such that

$$
f\left(x^{2}+y+f(y)\right)=2 y+(f(x))^{2}
$$

for any $x, y \in \mathbb{R}$.
2. It follows by

$$
f\left(x^{2}+y+f(y)\right)=2 y+(f(x))^{2}
$$

that the function $f$ is surjective. Note also that $(f(x))^{2}=(f(-x))^{2}$. In particular, we may choose $a$ such that $f(a)=f(-a)=0$. Setting $x=0, y= \pm a$ in (1) gives $0=f( \pm a)=(f(0))^{2} \pm 2 a$, i.e., $a=0$. Plugging $y=-\frac{(f(x))^{2}}{2}$ in (1), we get that $f\left(x^{2}+y+f(y)\right)=0$ and therefore $y+f(y)=-x^{2}$. Thus the function $y+f(y)$ takes any non-positive value. Since $f(0)=0$, it follows from (1) that

$$
f\left(x^{2}\right)=\left((f(x))^{2} \geq 0 \text { and } f(y+f(y))=2 y\right.
$$

Setting $z=x^{2}, t=y+f(y)$, and using again (1) we deduce that $f(z+t)=$ $f(z)+f(t)$ for any $z \geq 0 \geq t$. For $z=-t$ we get $f(-t)=-f(t)$ and then it is easy to check that $f(z+t)=f(z)+f(t)$ for any $z$ and $t$. Since $f(t) \geq 0$ for $t \geq 0$. it follows that $f$ is an increasing function. Suppose that $f(y)>y$ for some $y$. Then $f(f(y)) \geq f(y)$ and we get

$$
2 y=f(y+f(y))=f(y)+f(f(y))>2 f(y)
$$

a contradiction. Hence $f(y) \leq y$. We see in the same way that $f(y) \geq y$, so $f(x) \equiv x$. This function obviously satisfies (1).