Let $I\in R$ be a nonemplty set. Show that $I$ is an interval iff any continuous function $f:I\rightarrow \{0,1\}$ is constant.

62 Views Asked by At

Let $I\in R$ be a nonemplty set. Show that $I$ is an interval iff any continuous function $f:I\rightarrow \{0,1\}$ is constant.

I've no idea how to handle this problem. Thanks in advance to anyone who comes up with a step - solution.

PS: I've asked a similar problem to this, but the community pointed out that the "problem" consisted of a contradiction. Indeed, due to my mistake, the question was asked wrongfully. Thanks to the people who pointed that out!

2

There are 2 best solutions below

1
On BEST ANSWER

If $I$ is an interval, any $f: I \to \{0,1\}$ must be constant, since IVT tells us that if $f(a)=0<1=f(b)\implies f(c)=1/2$ for $c \in (a,b)$. This is a contradiction.

On the other hand, suppose that every continuous $f:I \to \{0,1\}$ is constant. If $I$ is disconnected, there exist nonempty disjoint open sets $A,B$ so that $A \cup B=I$. But then just set $f(A)=0$ and $f(B)=1$. This function will be continuous, a contradiction.

0
On

Sketch of proof:

First, suppose that $I$ is an interval. Use the intermediate value theorem to show that if $f$ is continuous, it must be constant.

Now, suppose that $I$ isn't an interval. Then $I$ is the union of at least two disjoint intervals (whose closures don't intersect). Define $f$ to be $0$ on one of these pieces and $1$ on the other. Why can the resulting $f$ be continuous?

Alternatively: if $I$ isn't an interval, it contains $a<b<c$ with $a,c \in I$ and $b \notin I$. Define $$ f(x) = \begin{cases} 0 & x < b\\ 1 & x > b \end{cases} $$ why is this function continuous?