Let $\mathbb{R}$ denote the set of real numbers. Determine all functions $f: \mathbb{R} \rightarrow \mathbb{R}$ such that

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

holds for all $x, y \in \mathbb{R}$.
If $f(x)=x$ for every real number $x$, then (1) is clearly satisfied. We will prove that this is the only solution.

First, we will show that $f$ is bijective, meaning it takes on every real number exactly once. If $c$ is any real number, then substituting $y=\left(c-(f(x))^{2}\right)$ into (1) shows that $f$ takes on the value $c$. We still need to prove that different numbers are mapped to different values. Let $y_{1}$ and $y_{2}$ be two different numbers and $x$ be arbitrary. According to (1),

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

and

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

If $f\left(y_{1}\right)=f\left(y_{2}\right)$ were true, then the left side of both equations would be the same number. This, however, contradicts the fact that the right sides are different. Therefore, $f\left(y_{1}\right) \neq f\left(y_{2}\right)$, and the function is indeed bijective.

Second, we will prove that the function is odd, meaning for every real number $x$, $f(-x)=-f(x)$, and specifically, $f(0)=0$. Let $x \neq 0$ and $y$ be arbitrary. Write the identity (1) for the pairs $x, y$ and $-x, y$:

$$
\begin{aligned}
& f\left(x^{2}+f(y)\right)=y+(f(x))^{2} \\
& f\left(x^{2}+f(y)\right)=y+(f(-x))^{2}
\end{aligned}
$$

Since the left sides are the same, $(f(x))^{2}=(f(-x))^{2}$, which implies $|f(x)|=|f(-x)|$; on the other hand, because of the bijectivity of $f$, $f(x) \neq f(-x)$. From these, it follows that $f(-x)=-f(x) \neq 0$. We see that $f$ takes the value 0 only at 0, so $f(0)$ can only be 0; thus, $f$ is indeed odd.

Now, substitute 0 for $x$ in (1); we get that for any $y$, $f(f(y))=y$.

We will also show that $f$ is monotonically increasing, meaning if $a \leq b$ are two real numbers, then $f(a) \leq f(b)$. Let $c$ be a number such that $b=a+c^{2}$. (Since $a \leq b$, such a number exists.) If we substitute $x=c$ and $y=f(a)$ into (1), we get

$$
f(b)=f\left(c^{2}+a\right)=f\left(c^{2}+f(y)\right)=y+(f(c))^{2}=f(a)+(f(c))^{2} \geq f(a)
$$

After this, it is easy to show that $f(x)=x$ for every $x$. Let $x$ be arbitrary. If $f(x)<x$, then $f(f(x))<f(x)$, which is a contradiction. If $f(x)>x$, then $f(f(x))>f(x)$, which is also a contradiction. Therefore, only $f(x)=x$ is possible.