20.17*. (Jury, France, 79). Find all monotonic invertible functions $f: \mathbf{R} \rightarrow \mathbf{R}$, satisfying the identity

$$
f(x)+f^{-1}(x)=2 x, \quad x \in \mathbb{R}
$$
20.17. Consider the function $g(x)=f(x)-x$ and prove that for any value $k \in \mathbf{Z}$ the identity

$$
f(x+k g(x))=x+(k+1) g(x) \quad(x \in \mathbb{R})
$$

holds. For $k=0$, we have the valid identity $f(x)=x+g(x)$. Suppose for some value $k \in \mathbf{N}$ the identities

$$
f(x+(k-1) g(x)) \equiv x+k g(x)
$$

and

$$
f(x-(k-1) g(x)) \equiv x-k g(x)
$$

have already been proven. Then, using the identity for the function $f(x)$ given in the problem, we obtain

$$
\begin{aligned}
f(x \pm k g(x)) & \equiv 2(x \pm k g(x))-f^{-1}(x \pm k g(x))= \\
& \equiv 2(x \pm k g(x))-(x \pm(k-1) g(x))=x \pm(k+1) g(x) .
\end{aligned}
$$

Using the established identity, we will prove that the function $g(x)$ is constant. Suppose, on the contrary, that for some values $x_{1}, x_{2} \in \mathbf{R}$ the inequality $g\left(x_{1}\right) < g\left(x_{2}\right)$ holds. 

Note that the function $f(x)$ is non-decreasing (otherwise, the function $f^{-1}(x)$, and with it the function $f(x)+f^{-1}(x)=2 x$, would be non-increasing, which is false). Therefore, for any value $n \in \mathbb{N}$, the function $f^{n}(x)$ is also non-decreasing. Thus, we have the inequality

$$
f^{n}\left(x_{1}-k g\left(x_{1}\right)\right) \geqslant f^{n}\left(x_{2}-k g\left(x_{2}\right)\right)
$$

from which, due to the equalities

$$
f^{n}\left(x_{i}-k g\left(x_{i}\right)\right)=f^{n-1}\left(x_{i}+(1-k) g\left(x_{i}\right)\right)=\ldots=x_{i}+(n-k) g\left(x_{i}\right)
$$

$(i=1,2)$, we obtain the inequality

$$
x_{1}+(n-k) g\left(x_{1}\right) \geqslant x_{2}+(n-k) g\left(x_{2}\right)
$$

However, for sufficiently large values of $n$, the last inequality is false (since $g\left(x_{1}\right) < g\left(x_{2}\right)$). Thus, the function $g(x) \equiv c$ is constant, and therefore,

$$
f(x)=x+c
$$

Note that for any value $c \in \mathbb{R}$, the function $f(x)=x+c$ satisfies all the conditions of the problem.