Show if $f:\mathbb{R} \to \mathbb{Z}$ continuous then $f$ is constant Show if $f:\mathbb{R} \to \mathbb{Z}$ is continuous then it is constant. 
Let $a$ be any real number then $\lim_{x \to a}f(x)=f(a)=b$ for $b\in \mathbb{Z}$. This means that taking $\epsilon=1$, there exists $\delta>0$ such that when $x\in (a-\delta,a+\delta),x≠a$, $f(x) \in (b-1,b+1)$, so $f(x)=b$ for a value other than $a$. 
Since $a$ can be chosen arbitrary, does this force $f$ to indeed be constant?
 A: Suppose $x,y\in\mathbb{R}$ and $f(x)=a$, $f(y)=b$, $a\ne b$.
It's not restrictive to assume $a<b$. Then, by the intermediate value theorem, there exists $z\in\mathbb{R}$ with $f(z)=a+\frac{1}{2}$, because
$$
a<a+\frac{1}{2}<b
$$
A: Suppose not. Then there exists x,y s.t $f(x)\ne f(y)$. Now if f is continuous, then $[f(x),f(y)]\subset \cup_{z\in \mathbb{Z}} f^{-1}(z)$. (by intermediate value theorem, and taking $f(x)<f(y)$ WLOG)
A countable union is generating an interval, which is a contradiction.
A: You are close.  
Let $f(a) = b$ then there exists a $\delta$ so that $|a - x| < \delta$ implies $f(x) \in (b-1, b+1)$ i.e. $f(x) = b$ for all $x \in (a-\delta, a+ \delta)$
Let $D = \{\delta > 0| x \in (a-\delta, a + \delta) \implies f(x) = b\}$
Let $d$ be in $D$ or a limit point of $D$.  Let $a' = a+ d$ and $a'' = a-d$.  Using the same argument there exists a $\gamma_1$ and $\gamma_2$ so that $x \in (a+d - \gamma_1, a+d + \gamma_1)$ implies $f(x) = b$ and $x \in (a - d - \gamma_2, a-d+\gamma_2)$ implies $f(x) = b$.
So $d$ is not an upper nor a lower bound of $D$.  If $D$ were either bounded above or below then the supremum or infinum of $D$ would be a limit point of $D$ and as no point of $D$ or limit point of $D$ is a extrema of $D$... $D$ is unbounded.  
So $x \in (x- \delta, x + \delta) \implies f(x) = b$ for all $\delta$.
So $f$ is a constant.
