Prove continuous function from R to Z is constant

49 Views Asked by At

$f$ is a continuous function from $\mathbb{R}$ to $\mathbb{Z}$. Prove it is a constant.

If $f$ is uniformly continuous, I'm able to prove it: If $f$'s domain is the empty-set or a single point, the matter is trivial. Else, assume $f$'s domain is an interval including $x$. Since $f$ is uniformly continuous, there exists an $\epsilon > 0$ such that for any $y$ in $(x-\epsilon, x+\epsilon)$, $|f(y) - f(x)| < 1/2$, and since both $f(x)$ and $f(y)$ are integers, $f(x) = f(y)$. By induction and the Archimedian principle, we can extend to the entire interval of $f$'s domain.

However, this fails if $f$ is not uniformly continuous, as the $\epsilon$s may vanish such that we never extend the interval to cover the entire domain.

A different approach is to argue that if $f$ is not constant, then for any $\epsilon > 0$, there exists an interval with length $< \epsilon$ where $f$ must take on two non-equal values. While I believe this to be true, I do not know how to prove it.

One approach may be to ask "What is the smallest $\delta$ such that $f(x) \neq f(x+\delta)$?" However, it is not clear that there needs to be a smallest $\delta$. While I feel that any continuous function will indeed have such, I again don't know how to prove it.

How can this be proven?