# suppose $f:\mathbb R\to\mathbb Z$ is continuous. Prove $f$ is constant.

I have an idea of what this problem is asking but I am having trouble deciding how I want to write it formally:

Suppose $f:\mathbb R\to\mathbb Z$ is continuous. Prove $f$ is constant.

I could be wrong, but I think I would need to show the neighborhoods around the different values in $\mathbb Z$ to show discontinuity, so that the only way that $f$ could be continuous would if $f$ were a single value in $\mathbb Z$? I could be way off base.

Any help is appreciated (I'm sorry if this question has already been asked, I could not find it).

• In the $\varepsilon$-$\delta$ definition of continuity, what happens if you set $\varepsilon = \tfrac{1}{2}$? Commented Feb 22, 2016 at 20:58

Hint: $\mathbb{R}$ is connected. A subset of $\mathbb{Z}$ with more than one point is not connected.

• Wow thank you for the fast response! That was what I was thinking as well, just felt shaky to me so I appreciate the comment. Commented Feb 22, 2016 at 20:58

Can you just use the intermediate value Theorem?

• Which version are you using?egreg's answer is basically using the general one, but the vanilla version is, if I'm not mistaken, for functions $f\colon \mathbb{R}\to\mathbb{R}$. (note that the definition of continuity of $f$ depends on the topoligcal spaces of the domain and range, so "seeing $f\colon \mathbb{R}\to\mathbb{Z}$ as a function $f\colon \mathbb{R}\to\mathbb{R}$ since $\mathbb{Z}\subseteq\mathbb{R}$" is misleading. The two functions are not the same, and continuity is not necessarily preserved... Commented Feb 22, 2016 at 21:30
• I was thinking that $f$ was continuous with respect to standard topology of $\mathbb R$ and $\mathbb Z$ was the codomain. Commented Feb 22, 2016 at 21:35