We say that $f:\mathbb R \rightarrow \mathbb R$ is locally constant if for each $x \in \mathbb R$ there is $\varepsilon\_x \gt 0$ such that the restriction of $f$ to the interval $I\_x = (x - \varepsilon\_x, x + \varepsilon\_x)$ is constant. Show that if $f: \mathbb R \rightarrow\mathbb R$ is locally constant and continuous, then $f$ is constant in $\mathbb R$.