Our topology teacher challenged us with this question:
Let $f: X \to Y$ continuous, $A \subset X$ dense. If $f|_A$ is constant and $Y=\mathbb{R}$, then $f$ it's constant everywhere.
I really don't know how to start with this one. Tried to suppose that $f|_A=c$ and $f|_{A^c}=B$ but I get nowhere.
Edit: Our only definition of dense is $Cl(A)=X$.
I'd appreciate any hint.
Thanks for your time.
Suppose that $f$ is not constant everywhere. In particular, if $f(x)=c$ for $x\in A$, then, there exists $x_0\notin A$ such that $f(x_0)\neq c$. Since the codomain is Hausdorff we can find neighbourhoods $U$ of $c$ and $V$ of $f(x_0)$ which are disjoint. So then $f^{-1} (U)$ and $f^{-1} (V)$ are disjoint.
Now we use the fact that $A$ is dense in $X$. We observe that $f^{-1} (V)$ is an open set containing $x_0$ and hence contains a point of $A$ which contradicts the fact that $f^{-1} (U)$ and $f^{-1} (V)$ are disjoint.
Note that the fact that $Y$ is the real line is unncesssary. We only needed that it was Hausdorff.