I refer to the answer in the following link as the source of my question.
In a metric space X, if A is connected, is its interior connected?
While I understand the counterexample given, I actually thought that the interior of a connected set is connected. My proof is as follows:
Since $A$ is a connected set, suppose we take any two-valued function $f$ on $A$. Then, for any $a \in A$, $f(a)=c$ for some constant $c$. Since $A^{\circ} \subset A$, the restriction of $f$ on $A^{\circ} $ is also constant, that is, $f|_{A^{\circ}}=c$ and hence the interior of a connected set is connected.
Does the two-valued function argument only work on $\mathbb{R}$ or am I missing something fundamental? Thank you.