## Task 1.

Given a function $f: \mathbb{R} \rightarrow \mathbb{R}$ such that for all real numbers $x$ and $y$,

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

and $f(2)=3$. Determine $f\left(2^{2016}\right)$.
## Solution.

By substituting $x=0$ and $y=0$ into the given equation, we get $2 f(0)=f(0)^{2}$. Therefore, we distinguish two cases: $f(0)=2$ and $f(0)=0$.

If $f(0)=2$, then by substituting $x=1, y=0$ we get $f(f(0))=f(1) f(0)$, which means $3=f(2)=2 f(1)$. Thus, $f(1)=\frac{3}{2}$. By substituting $x=0, y=1$ we get $2 f(0)=f(0) f(1)$, which gives $f(0)=0$, leading to a contradiction.

If $f(0)=0$, then by substituting $y=0$ we get $f\left(x^{2}\right)=f(x) x$, so the original equation becomes $f(x f(y))=f(x) f(y)$. By substituting $y=x$, we get $f(x f(x))=f\left(x^{2}\right)$.

Applying $f$ to the given equation, we get

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

and by substituting $x=y$ and using $f(x f(x))=f\left(x^{2}\right)$, we get

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

By substituting $x=1$ into $f(x f(y))=f(x) f(y)$, we get $f(f(y))=f(1) f(y)$, which together with $f\left(f\left(x^{2}\right)\right)=f(x)^{2}$ gives

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

Thus, for every $x$, $f(x)=x f(1)$ or $f(x)=0$.

Since $f(2) \neq 0$, we get $f(1)=\frac{3}{2}$.

By substituting $y=2$, we get $f(3 x)=3 f(x)$, and by iteration, we get $f\left(3^{2016}\right)=\frac{1}{2} \cdot 3^{2017}$.

By substituting $y=1$, we get

$$
f\left(\frac{3}{2} x\right)=\frac{3}{2} f(x)
$$

which gives $f\left(2^{2016}\right)=3 \cdot 2^{2015}$.

To verify that there indeed exists a function that satisfies these values and the given equation, consider the function $f(x)=\frac{3}{2} x$.