## Task 1.

Determine all functions $f: \mathbb{R} \rightarrow \mathbb{R}$ such that for all real numbers $x$ and $y$,

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

Let $a=f(0)$. By substituting $x=y=0$ into the initial equation, we get $f(a)=$ $a^{2}$.

By substituting $y=0$ into the initial equation, we get:

$$
f\left(x^{2}+a\right)=f(x)^{2} \text {. }
$$

By substituting $x=a$ into this equality, we obtain: $f\left(a^{2}+a\right)=f(a)^{2}=a^{4}$.

Assume there is $a0$ such that $a=-b^{2}$. By substituting $x=b$ into (3), we get:

$$
a=f(0)=f\left(b^{2}+a\right)=f(b)^{2} \geqslant 0
$$

which is a contradiction. Therefore, $a \geqslant 0$.

By substituting $x=\sqrt{a}, y=a$ into the initial equation, we have:

$$
f\left(a+a^{2}\right)=\left(f(\sqrt{a})+a^{2}\right)^{2}
$$

We have obtained

$$
f\left(a+a^{2}\right)=\left(f(\sqrt{a})+a^{2}\right)^{2}=a^{4}
$$

i.e.,

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

Assume $f(\sqrt{a})=-2 a^{2}$. If we let $x=\sqrt{\sqrt{a}+2 a^{2}}, y=\sqrt{a}$, then:

$$
f\left(x^{2}+f(y)\right)=f\left(\sqrt{a}+2 a^{2}-2 a^{2}\right)=f(\sqrt{a})=-2 a^{2}0$ for which $f(t)0
$$

which is only possible if $f(x)=x^{2}$ for all $x \geqslant 0$.

Let $w$ be any positive number. By substituting $-w$ for $x$ in $f\left(x^{2}\right)=(f(x))^{2}$, we get that $f(-w)=w^{2}$ or $f(-w)=-w^{2}$. However, if $f(-w)=-w^{2}$, by substituting $x=w, y=-w$ into the given equation, we get:

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

which is not possible.

Therefore, the only possible solution to the given equation is $f(x)=x^{2}$. It is easily verified by direct substitution that this function indeed satisfies the initial equation.