TITLE: Any continuous map $f:\mathbb{R}\to\mathbb{Z}$ is constant
QUESTION [0 upvotes]: Not really sure how to proceed with this one. Can anyone help?
The question is:

Show that any continuous map $f: \mathbb{R}\to\mathbb{Z}$ is constant.

REPLY [0 votes]: Let $x$ be a real number. Note that $\{f(x)\}$ is a closed-open set in $\mathbb{Z}$. So $f^{-1}(\{f(x)\})$ must be a closed-open set of $\mathbb{R}$. Because it's not empty (it contains $x$) and $\mathbb{R}$ is connected, it follows that $f^{-1}(\{f(x)\})=\mathbb{R}$. $f$ is constant. 
This only uses basic facts about connexity (the definition and $\mathbb{R}$ being connected) but if you want to go faster, you can just say that if $f$ is not constant, then $f(\mathbb{R})$ is a set containing at least two elements. It's not connected but continuous maps maintain connexity and $\mathbb{R}$ is. There's a contradiction.
{"set_name": "stack_exchange", "score": 0, "question_id": 3533235}