9. find all functions $f: \mathbb{R} \rightarrow \mathbb{R}$ such that $x, y \in \mathbb{R}$ holds for all $x, y \in \mathbb{R}$:

$$
(f(x)+y)(f(x-y)+1)=f(f(x f(x+1))-y f(y-1))
$$
Solution (Paul): Let $x=0, y=1$ :

$$
(f(0)+1)(f(-1)+1)=f(0)
$$

If we set $y=-f(x)$, it immediately follows that an $a \in \mathbb{R}$ exists with $f(a)=0$. Now we set $x=a, y=0$ :

$$
0=f(f(a f(a+1)))
$$

And now $x=a, y=a+1$ :

$$
(a+1)(f(-1)+1)=f(f(a f(a+1)))=0
$$

If $a=-1$, the first equation would yield $f(0)+1=f(0)$, a contradiction. Consequently, $a+1 \neq 0$, so that $f(-1)=-1$ follows from the last equation. If we insert this into the first equation, $f(0)=0$ immediately follows. For $x$ we now insert 0 and -1 one after the other so that

$y f(-y)+y=f(-y f(y-1))=(y-1)(f(-1-y)+1) \Longleftrightarrow y f(-y)+f(-1-y)+1=y f(-1-y)$.

If we replace $y$ with $-y$ here, we get the form:

$$
y f(y)=y f(y-1)+f(y-1)+1
$$

Now we insert $y=0, y=1$ one after the other into the original equation:

$f(x)^{2}+f(x)=f(f(x f(x+1)))=(f(x)+1)(f(x-1)+1) \Longleftrightarrow f(x)^{2}=f(x) f(x-1)+f(x-1)+1$.

We now subtract the last two equations obtained from each other and get

$$
f(x)^{2}-x f(x)=f(x) f(x-1)-x f(x-1) \Longleftrightarrow(f(x)-x)(f(x)-f(x-1))=0
$$

So if we can show for all real $x$ that $f(x) \neq f(x-1)$ applies, $f(x)=x$ follows and we are done. All we need to do is show injectivity.

Let $a$ again be an arbitrary zero of $f$. In the original equation, set $x=0, y=a+1$ :

$$
(a+1)(f(-a-1)+1)=0
$$

using the same reasoning as before $f(-a-1)=-1$. Now let $x=0, y=-a$ :

$$
-a=f(a f(-a-1))=f(-a)
$$

Then follows with $x=-1, y=-a$ :

$$
(-1-a)(f(a-1)+1)=f(a f(-a-1))=f(-a)=-a \Longleftrightarrow f(a-1)=\frac{-1}{1+a}
$$

since $a \neq-1$ is. Then for $x=a-1, y=0$ :

$$
\frac{1}{(a+1)^{2}}-\frac{1}{a+1}=0 \Longleftrightarrow a=0
$$

Consequently, 0 is the only zero of $f$, i.e. $f$ is injective at 0 .

With $y=-f(x)$ then follows:

$$
0=f(f(x f(x+1))+f(x) f(-f(x)-1)) \Longrightarrow f(x f(x+1))=-f(x) f(-f(x)-1)
$$

due to the injectivity at 0 . With $x=y-1$ follows:

$0=f(f((y-1) f(y))-y f(y-1)) \Longrightarrow f((y-1) f(y))=y f(y-1) \Longleftrightarrow f(y f(y+1))=(y+1) f(y)$,

if we replace $y$ with $y+1$, again using injectivity at 0. A comparison of the last two equations yields

$$
(y+1) f(y)=-f(y) f(-f(y)-1)
$$

For $y \neq 0$ we can truncate $f(y)$ and we are left with $f(-f(y)-1)=-y-1$, which is true even for $y=0$. With this equation, we can now show injectivity. If $u, v \in \mathbb{R}$ with $f(u)=f(v)$, the following applies

$$
-u-1=f(-f(u)-1)=f(-f(v)-1)=-v-1 \Longrightarrow u=v
$$

as requested. So we're done.

Inserting shows that $f(x)=x$ is really a solution.

## Marking Scheme:

- 1 point for $f(0)=0$
- 2 points for injectivity at 0
- 1 point for injectivity on the whole $\mathbb{R}$
- 2 points for $f(x)^{2}-x f(x)=f(x) f(x-1)-x f(x-1), 1$ more for factorization