[Math] A continuous function with a finite image must be constant

connectednesscontinuitygeneral-topologyproof-verification

I was recently tasked to prove:

Let $f:[a,b] \mapsto N$ (where $N$ is $\mathbb{R}$ or $\mathbb{C}$). If $f$ is continuous and takes a finite number of values (that is $\{f x\mid x\in[a,b]\}$ is finite) then $f$ must be a constant function.

My first thought was to play around with arbitrary sets (as opposed to $[a,b]$), see which sets fit this statement and which sets fail. If I could isolate the relevant property I might be able to see why this is true. After a bit of playing around I came to the conclusion that this was probably true for all connected sets and probably not so true for sets that are not connected. I was then able to come up with what I believed to be a proof that this property held for connected sets in general:

Let us say that we have a clopen set $S$ on a connected set $\xi$.
Since the compliment of a closed set is open and vice versa, the compliment of a clopen set must also be clopen.
Thus both $S$ and $\xi \setminus S$ must be clopen. Because they are compliments they are disjoint. That is to say $S \cap (\xi \setminus S) = \{\}$.
Because the clopen sets are their own closure we also know that

\begin{equation*}
S \cap \overline{(\xi\setminus S)} = \{\} =
\overline{S} \cap (\xi\setminus S)
\end{equation*}

The definition of connectedness shows us that there are no $A$ and $B$ such that

\begin{gather*}
A \cup B = \xi \\
\land \\
A \neq \{\} \land B \neq \{\} \\
\land \\
A \cap \overline{B} = \{\} = \overline{A} \cap B
\end{gather*}

Since $S$ and $\xi\setminus S$ satisfy the first and last properties, either $S = \{\} \lor \xi\setminus S = \{\}$, that is to say there are only two clopen sets, the empty ($\{\}$) and universal ($\xi$)

Given a continuous function $f : S \mapsto N$ such that the only sets that are clopen on $S$ are $S$ and $\{\}$ we can show that if $f S$ is finite $f S = \{x\}$.

Let us consider a point $x$ in the codomain of $f$.
Let us consider the sets $\{x\}$ and $\{x\} \cup N \setminus f S$ (Everything in $N$ outside of the codomain and $x$).
$\{x\}$ is clearly closed on $N$ because it is a singleton, $\{x\} \cup N \setminus f S$ is open on $N$ because $N$ is open, and any open set minus a finite set is open.
The preimage of both these sets is the same because both of them only contain one point in the codomain.
Since $f$ is continuous we know that the preimage of a closed set is closed and the preimage of an open set is open.
Thus the preimage of $\{x\}$ is clopen on the domain, and is thus either $S$ or $\{\}$.
It is obviously not the null set because $x$ is in the codomain thus something must map to it. So it must be the domain.
Since $f^{-1} \{x\} = S$, $f S \subseteq \{x\}$.
Since $f S \neq \{\}$, $f S = \{x\}$.

Thus any function from a connected set to a finite set is a constant function.

I have been told there is an error in my proof here (or at least I am jumping over some non-trivial step), but I cannot find it. I was further given the hint that I was making a mistake in the way I set up the topology.

Where is my mistake? Am I making any unwarranted assumptions?

Best Answer

The statement "Thus any function from a connected set to a finite set is constant." is incorrect. It should say "Any $continuous$ function from a connected set (space) to a $discrete$ space is constant.

The omission of "continuous" in that concluding sentence is, I think, a minor accident.

The important omission is the dependence on the topology of the image-space. The usual topology on $\Bbb N$ is discrete. But if the only open subsets of a space $B$ are $B$ and $\emptyset$, then any function into $B$ is continuous.

The continuous image of a connected space is a connected space. A continuous image of a disconnected space can be anything.

Related Question