Exercise 17. Let $\alpha \neq 0$. Find all functions $f: \mathbb{R} \rightarrow \mathbb{R}$ such that for all real numbers $x, y$,

$$
f\left(x^{2}+y+f(y)\right)=f(x)^{2}+\alpha y
$$
## Solution to Exercise 17

Let $x=0$. Then the equation becomes $f(y+f(y))=f(0)^{2}+\alpha y$ for all $y$. Since $\alpha$ is non-zero, the right-hand side describes all real numbers as $y$ varies, and thus $f$ is surjective.

Let $y=0$. Then we can write for all real $x$,

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

We know that $f$ is surjective, so let $c$ be a preimage of 0. The equation in the statement with $x=0$ and $y=c$ gives

$$
\alpha c + f(0)^{2} = f(0 + c + f(c)) = f(c) = 0
$$

But we know that $f(-c)^{2} = f(c)^{2} = 0$, so $-c$ is also a preimage of 0. By the equation above applied to $c$ and $-c$, we have $\alpha c + f(0)^{2} = 0 = -\alpha c + f(0)^{2}$. Since $\alpha \neq 0$, we deduce that necessarily $c = 0$.

Now that we know 0 is the only preimage of 0, we set the right-hand term in the initial equation to zero by choosing $y=-\frac{f(x)^{2}}{\alpha}$, then $f\left(x^{2}+y+f(y)\right)=0$, which means $x^{2}+y+f(y)=0$ or

$$
\begin{gathered}
x^{2}-\frac{f(x)^{2}}{\alpha}+f\left(-\frac{f(x)^{2}}{\alpha}\right)=0 \\
x^{2}=\frac{f(x)^{2}}{\alpha}-f\left(-\frac{f(x)^{2}}{\alpha}\right)
\end{gathered}
$$

for all real $x$. Therefore, if $f(x) = \pm f(x')$, the above equation gives $x^{2} = x'^{2}$, so $x = \pm x'$.

Let $x \neq 0$ be a real number. Consider the equation $f(x') = \pm f(x)$. We have seen that this equation has exactly two solutions, which are $x$ and $-x$ (which are distinct since $x \neq 0$). But there is a solution to $f(x') = -f(x)$ by the surjectivity of $f$. Since $f(x) \neq 0$, it cannot be $x' = x$, so it must be $x' = -x$. Thus, $f(-x) = -f(x)$, and the only solution to $f(x') = f(x)$ is $x' = x$. Since 0 is the unique preimage of 0, $f$ is both odd and injective.

The initial equation with $y=0$ gives for all real $x$, $f(x^{2}) = f(x)^{2}$. Thus, the equation in the statement can be rewritten as

$$
\forall x, y \in \mathbb{R}, \quad f\left(x^{2}+y+f(y)\right) = f\left(x^{2}\right) + \alpha y
$$

so with $z = x^{2}$,

$$
\forall y \in \mathbb{R}, z \geqslant 0, \quad f(z+y+f(y)) = f(z) + \alpha y
$$

If now $z \leqslant 0$, we compute for all $y$, by the oddness of $f$,

$$
\begin{aligned}
f(z+y+f(y)) & = -f(-z-y-f(y)) = -f((-z)+(-y)+f(-y)) \\
& = -(f(-z) + \alpha(-y)) = f(z) + \alpha y
\end{aligned}
$$

This is the same equation as for $z \geqslant 0$, so

$$
\forall y, z \in \mathbb{R}, \quad f(z+y+f(y)) = f(z) + \alpha y
$$

With $z=0$, we have in particular for all $y$, $f(y+f(y)) = \alpha y$. Let $z = x + f(x)$ in the above equation to get for all $x, y \in \mathbb{R}$,

$$
f(x+f(x)+y+f(y)) = f(x+f(x)) + \alpha y = \alpha x + \alpha y = \alpha(x+y) = f(x+y+f(x+y))
$$

and thus, by injectivity, $f(x+y) = f(x) + f(y)$. Therefore, $f$ is a solution to Cauchy's equation. But $f$ is increasing because if $x > y$, we have

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

so $f$ is linear on $\mathbb{R}$. From the equation $f(x^{2}) = f(x)^{2}$, its leading coefficient satisfies $a^{2} = a$ so $a = 0$ or $a = 1$, meaning $f$ is either the zero function or the identity on $\mathbb{R}$. Since $f$ is surjective, it must be the identity: for all $x$, $f(x) = x$.

Substituting back into the equation, we get

$$
\forall x, y \in \mathbb{R}, \quad x^{2} + 2y = x^{2} + \alpha y
$$

so with $x=0, y=1$, we have $\alpha = 2$ necessarily. Conversely, if $\alpha = 2$, the identity is indeed a solution by the previous calculation. Thus, if $\alpha \neq 2$, there are no solutions, and if $\alpha = 2$, the identity is a solution.

Comment from the graders: The exercise was very little attempted, a handful of students solved it perfectly. Some tried quite natural beginnings of a solution, showing in particular that $f$ is surjective and that $f(0) = 0$, but did not go further. Be careful to note for which values the equalities obtained are indeed true: when substituting one variable in terms of another, we lose generality. For example, after setting $y = f(-x^{2})$, the resulting equality is not true for all $x$ and $y$.