Let $f$ be a function of the real line to itself which preserves distance and sends integers to integers.
(i) Assuming that $f$ has no fixed points, show that $f$ is a translation through an integral distance.
(ii) If $f$ leaves exactly one point fixed, show that this point is either an integer or halfway between two integers, and that $f$ is a reflection in this fixed point.
(iii) If $f$ leaves more than one point fixed, then $f$ must be the identity.
Let $f$ be a function of the real line to itself which preserves distance and sends integers to integers.
(i) Assuming that $f$ has no fixed points, show that $f$ is a translation through an integral distance.
Define $f(x)=x+b$, where $b\in\mathbb{Z}$ . It's clear that this function preserves distance and sends integers to themselves. Furthermore, the value of $b$ cannot be 0 otherwise every point is fixed.
(ii) If $f$ leaves exactly one point fixed, show that this point is either an integer or halfway between two integers, and that $f$ is a reflection in this fixed point.
Define $f(x)=ax+b=x$, where $a,b\in\mathbb{Z}$, and let $x_0,x_1$ be two distinct points. Since $f$ preserves distance, we have $$\vert x_1-x_0\vert=\vert(ax_1+b)-(ax_0+b)\vert=\vert a\vert\vert x_1-x_0\vert$$ Therefore $a=\pm 1$. Suppose further that $x_0$ is the fixed point. When $a=1$, we have $f(x_0)=x_0+b=x_0$ which implies $b=0$ and $f$ is the identity function leaving every point fixed which is not possible. When $a=-1$ we have $f(x_0)=-x_0+b=x_0$ which implies $x_0=b/2$ for any value of $b$. And since $b$ is an integer to begin with, this fixed point is either an integer or halfway between two integers.
To prove $f$ is a reflection in the fixed point, write any real number as $x+b/2$ where $x\in\mathbb{R}$. Then $f(x+b/2)=-(x+b/2)+b=-x+b/2$, which is precisely the reflection of the point $x+b/2$ in the fixed point $b/2$.
(iii) If $f$ leaves more than one point fixed, then $f$ must be the identity.
Let $x_0,x_1$ be two distinct fixed points and again define $f(x)=ax+b$, where $a\in\{-1,1\}$ and $b\in\mathbb{Z}$. If $a=1$, then $f(x)=x+b$ and since $x_0$ is a fixed point, $x_0+b=x_0$ or $b=0$. For $a=-1$, $f(x)=-x+b$ and the distinct fixed points $x_0,x_1$ yield two distinct values for $b$, namely $2x_0$ and $2x_0$. Hence, in each case $f$ must be the identity.