After hearing about "locally constant". This question popped up in my mind.
Is there a continuous non-constant function $f: \mathbb{R} \to \mathbb{R}$ which is locally constant everywhere? That is given any $r \in \mathbb{R}$, there exists $\epsilon >0$ such that $f(B_{\epsilon}(r))=\{f(r)\}$. In words, given any $r \in \mathbb{R}$, there is a neighborhood of $r$ where such that the restriction of the function $f$ is constant.
I tried to solve this problem by assuming that $x \neq y$ and then showing that $f(x)=f(y)$, but it is possible that we cannot do that in finite number of steps, and even in countably infinite number of steps. then how can I solve this?