## Task A-4.2.

Determine all functions $f: \mathbb{R} \rightarrow \mathbb{R}$ such that for all $x, y \in \mathbb{R}$, the following holds:

$$
f\left(x^{2}+f(y)\right)=y-x^{2}
$$
## Solution.

By substituting $x=0$ into the given equation, we get $f(f(y))=y$ for every $y \in \mathbb{R}$.

Therefore, for all $x, y \in \mathbb{R}$, we have:

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

Substituting $y=x^{2}$ into $(*)$ gives us

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

or equivalently,

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

while substituting $y=0$ into $(*)$ yields:

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

We conclude that for every real number $x$, we have:

$$
f(x)=-x+c
$$

where we denote $c=f(0)$.

Let's verify that all functions of the form $f(x)=-x+c$ for $c \in \mathbb{R}$ satisfy the given equation:

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