3. determine all functions $f: \mathbb{R} \rightarrow \mathbb{R}$ so that the following equation is satisfied for all $x, y \in \mathbb{R}$:

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

## Solution:

We first set different things for $x$ and $y$:

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

We give two solutions, one using equation (2), the other (3) and (4).
## 1st solution:

Since every non-negative number is of the form $x^{2}$, it follows immediately from (2)

$$
f(x)=x+f(0)^{2} \quad \forall x \geq 0
$$

Now let $z>0$. Set $x=-z$ and $y=z$ in the original equation, then $f\left(4 z^{2}\right)=z^{2}-2 z f(-z)+f(z)^{2}$. According to (5), $f\left(4 z^{2}\right)=4 z^{2}+f(0)^{2}$ and $f(z)=z+f(0)^{2}$. If you insert this, you get

$$
\begin{aligned}
2 z f(-z) & =z^{2}+f(z)^{2}-f\left(4 z^{2}\right) \\
& =z^{2}+\left(z+f(0)^{2}\right)^{2}-\left(4 z^{2}+f(0)^{2}\right) \\
& =2 z\left(-z+f(0)^{2}\right)+\underbrace{\left(f(0)^{4}-f(0)^{2}\right)}_{=0}=2 z\left(-z+f(0)^{2}\right)
\end{aligned}
$$

where we still used (1) in the last line, squaring gives $f(0)^{2}=f(0)^{4}$. Because $z>0$ we can divide by $2 z$ and get $f(-z)=-z+$ $f(0)^{2}$, i.e.

$$
f(x)=x+f(0)^{2} \quad \forall x<0
$$

Finally, $f(0)=0$ or $f(0)=1$ follows from (1), with (5) and (6) this results in the two functions

$$
f(x)=x \quad \text { and } \quad f(x)=x+1
$$

By inserting, you can easily confirm that both are actually solutions.