# 2 valued function defined on a connected set must be a constant function

How to prove by definition that 2 valued function defined on a connected set must be a constant function. I know how to prove the statement but i wanna know how to apply the $\epsilon- \delta$ definition of continuous functions to prove it. I guess may be using the contra positive or contradiction would allow to apply but not sure how to do it.

-
I think that you want to show that if X is connected then any continuous function from X to {0,1} must be constant – Amr Nov 23 '12 at 11:09
@Amr yup, but i wanna apple the definition as well in the proof. – Mathematics Nov 23 '12 at 11:10
Do you know the fact that if f is continous and U is open then $f^{-1}(U)$ is open – Amr Nov 23 '12 at 11:11
@Amr of course, i know that theorem. – Mathematics Nov 23 '12 at 11:25
I don't quite get why there is downvote – Mathematics Nov 23 '12 at 15:51

Note that every connected subset of $\mathbb{R}$ is an interval. Let $C$ denote the connected subspace in question. If $f : C \to \mathbb{R}$ is two valued, then without loss of generality we may assume that $C = [ a , b ]$ where $a < b$ are such that $f(a) \neq f(b)$. (The restriction of $f$ to such a subset will still be continuous.)
In the sequel we will always find $\delta > 0$ with respect to $\epsilon = f(a) - f(b) > 0$. (Note that given $z \in [a,b]$ if $\delta > 0$ is such that $| f(x) - f(z) | < \epsilon$ for all $| x - z | < \delta$, then $f(x) = f(z)$ for all $| x - z | < \delta$.)
Consider $$s = \sup \{ x \in [a,b] : f(x) = f(a) \}.$$ Continuity of $f$ implies that $a < s < b$. Let $\alpha = \min \{ s - a , b - a \}$. Now what is $f(s)$?
• If $f(s) = f(a)$, then there is a $0 < \delta < \alpha$ such that $f(x) = f(s) = f(a)$ for all $| x - s | < \delta$. In particular, $f ( s + \frac{\delta}{2} ) = f(s) = f(a)$, contradicting that $s$ is an upper bound of $\{ x \in [a,b] : f(x) = f(a) \}$.
• If $f(s) = f(b)$, then there is a $0 < \delta < \alpha$ such that $f(x) = f(s) = f(b)$ for all $| x - s | < \delta$. This then implies that $s - \delta$ is an upper bound of $\{ x \in [a,b] : f(x) = f(a) \}$, contradicting that $s$ is the supremum of this set.
That's really a good answer but i want to why you need the $\alpha$, can't we just say there exist a $\delta$? – Mathematics Dec 7 '12 at 17:29