Example of a continuous map having a connected codomain but a disconnected domain.

general-topologymetric-spacesreal-analysis

As I was working problems on connectedness (of metric spaces and subsets of metric spaces) for my analysis class, I came across a generalized form of the intermediate value theorem that stated: the continuous image of a connected set is connected. While this interesting and all, it got me thinking:

Are there examples of continuous maps having a connected codomain, but a disconnected domain?

I think I may have constructed one, but I am unsure if this is correct or not: define the continuous function $f : (-\infty, 0) \cup (0, \infty) \to \{5\}$ by $f(x) := 5$. Therefore, the codomain is clearly connected and the domain is disconnected? As I thought more about this, wouldn't constructing such examples contradict the (generalized) intermediate value theorem?

Best Answer

Your example is a perfectly good. It absolutely does not violate the generalized IVT. The IVT, in this form, says that the continuous image of a connected set is connected. It says nothing about the continuous preimage of a connected set, which as your example shows, can be disconnected.

Related Question