Prove $X$ is Connected if $f(X)$ is Connected for Every Continuous $f:X\rightarrow \mathbb{R}$ – Analysis

analysisconnectednesscontinuitymetric-spaces

Prove $X$ (Metric Space) is connected $\iff$ for every continuous $f:X\rightarrow \mathbb R$, $f(X)$ is connected and $ \subset \mathbb R$

I'd appreciate if somebody posted a whole answer, so that I can work through it.

I tried proving by contradiction.
Assume $X$ is connected but $f(X)$ is not. Then we can find open sets $U,V$ that partition $f(X)$ and their intersection is empty.

Then $f^{-1}(U)\cap(X)\subset X$ and $f^{-1}(V)\cap(X)\subset X$. Since $U\cap V$ is empty we also get that $f^{-1}(U)\cap f^{-1}(V)$ is empty. Thus they $f^{-1}(U)\cap(X)$ and $f^{-1}(V)\cap(X)$ partition $X$ which is a contradiction?

This proof would work for $f:X\rightarrow Y$ where $Y$ is another metric space, but does it also work for $\mathbb R$?

Best Answer

It is straightforward, using the definition of continuity and connectedness to show that if $f(X)$ is not connected, then $X$ is not connected. That is, if $f(X) = W \cup Z$ where $W,Z$ are two non empty disjoint open sets, then $f^{-1}(W), f^{-1}(Z)$ are two non empty disjoint open sets whose union equals $X$. This proves one direction.

If $X$ is disconnected, then there are two non empty disjoint open sets $U,V$ such that $X=U\cup V$. Define $f(u) = 1$, for $u \in U$ and $f(v) = 0$ for $v \in V$. Since $f(X)$ is not connected you have shown the other direction.

Addendum: To show that $f$ is continuous, we need to show that $f^{-1}(W)$ is open for all open $W \subset \mathbb{R}$. There are only four cases to consider (1) $\{0,1\} \subset W$, in which case $f^{-1}(W) = X$, (2) $ 1 \in W, 0 \notin W$, in which case $f^{-1}(W) =U$, (3) $ 0 \in W, 0 \notin W$, in which case $f^{-1}(W) =V$ and (4) $\{0,1\} \cap W = \emptyset$, in which case $f^{-1}(W) = \emptyset$.

In all cases, $f^{-1}(W)$ is open, hence $f$ is continuous.

Related Question