“Continuous maps are those maps that do not tear space apart”

In a tutorial I wanted to give a quick explanation of the property of continuity. One of the common intuitions for continuity is that it preserves connection:

Continuous maps do not map connected sets onto disconnected sets, since the restriction of a continuous map to a subspace is again continuous one sees

A continuous map maps every connected subset of a space onto a connected set, in other words continuous maps do not "tear the space apart".

This is nice, but does the reverse also hold? Ie is every map that maps connected subsets to connected sets continuous?

I would think not, but can't think of a counter-example.

Bonus question: Maybe if the domain/image space has certain niceness properties equivalence holds, what could be some examples of such niceness properties?

• The two-point Sierpinski space, with one open point and one closed point, is a standard counterexample. The function that switches the two points is not continuous, but certainly preserves connectedness. – Slade May 15 '16 at 11:12
• Not all bijectice maps between two intervals are continuous. – Michael Hoppe May 15 '16 at 11:14
• @Slade If the open sets are $\emptyset, \{x\},\{x,y\}$ then every subset is connected isn't it? Edit: Ah nevermind, I got mixed up myself in what I was asking, yes this is a counterexample – s.harp May 15 '16 at 11:16
• @MichaelHoppe neither do they necessarily preserve connectedness of sub-intervals. – s.harp May 15 '16 at 11:16
• @s.harp That's correct. – Slade May 15 '16 at 11:17

On $\{x,y\}$ with open sets being $\{\emptyset, \{x\},\{x,y\}\}$ every set is connected. The map into itself given by $f(x)=y, f(y)=x$ is not continuous. But since all sets in the image space are connected it satisfies the property.
The other example is the map $f: [0,1]\to[-1,1]$ given by
$$f(x)=\begin{cases}\sin(1/x) & x\neq0 \\0&x=0\end{cases}$$
This map is not continuous, but any connected set containing $0$ is either $\{0\}$ or contains an interval $[0,\epsilon)$. In the first case the set is mapped to $\{0\}$, which is connected, in the second to $[-1,1]$ which is also connected. Since the restriction of the map to sets not containing zero is continuous, it maps connected sets not containing $0$ to connected sets.