5. determine all functions $f: \mathbb{R} \rightarrow \mathbb{R}$ for which applies:

(a) $f(x-1-f(x))=f(x)-1-x$ for all $x \in \mathbb{R}$,

(b) The set $\{f(x) / x \mid x \in \mathbb{R}, x \neq 0\}$ is finite.

## Solution
We show that $f(x)=x$ is the only solution. Set $g(x)=f(x)-x$. If we substitute $f(x)=g(x)+x$ in (a), the simpler equation for $g$ follows

$$
g(-1-g(x))=2 g(x)
$$

Because $f(x) / x=(g(x)+x) / x=g(x) / x+1$ and (b), it follows that the set $\{g(x) / x \mid x \in \mathbb{R}, x \neq 0\}$ is also finite. Set $A=\{x \in \mathbb{R} ; \mid x \neq 0, g(x) \neq-1\}$. For $x \in A$ we can divide (3) by $-1-g(x)$ and get

$$
\frac{g(-1-g(x))}{-1-g(x)}=\frac{-2 g(x)}{g(x)+1}=h(g(x))
$$

where $h(x)=-2 x /(x+1)$. The left-hand side of this equation only takes on a finite number of values, and so does the right-hand side. Now the function $h: \mathbb{R} \backslash\{-1\} \rightarrow \mathbb{R} \backslash\{-2\}$ is bijective with inverse function $h^{-1}(x)=-x /(x+2)$. Therefore, $g(x)$ for $x \in A$ only has a finite number of values. According to the definition of $A$, however, this means that $g(x)$ can only take on a finite number of values. From this it now immediately follows $g(x)=0 \forall x \in \mathbb{R}$ and we are done. Assume that this is not the case and that $a=g(c) \neq 0$ is the largest value that $g$ can take. Set $x=c$ in (3), then $g(-1-a)=2 a$ follows, in contradiction to the maximality of $a$.