Let R\mathbf{R} denote the set of all real numbers. Find all functions f:RRf: \mathbf{R} \to \mathbf{R} such that

f(x2+f(y))=y+(f(x))2for all x,yR.f \left(x^2 + f(y)\right) = y + \left(f(x)\right)^2 \quad \text{for all } x, y \in R.