[Math] Preserving compactness and connectedness implies continuity for functions between locally connected, locally compact spaces

compactnessconnectednesscontinuitygeneral-topology

In this question: Connected and Compact preserving function is not continuous example?
It is mentioned that "a function between locally-compact, locally-connected topological spaces which preserves connected and compact subsets is in fact continuous". I've come close to coming up with a proof for functions between $ \mathbb{R} $ , but the more general statement above seems much more interesting, however I haven't been able to find a proof anywhere or to think of a way to prove it myself.

Could someone provide a reference, where I could find the proof of that? Or a counterexample if the statement is actually false.

EDIT: As was pointed out in an answer below, the statement turns out false with a very simple counterexample, in which the spaces are not Hausdorff. Perhaps the additional condition of both spaces being Hausdorff will be sufficient to make it true?

EDIT2: Since some people asked, here's my proof for $ f: \mathbb{R} \rightarrow \mathbb{R} $:

Assume f is not continuous at a point $ x$. We can find a sequence $ x_n \rightarrow x $ monotonically with no subsequence of $ f(x_n) $ converging to $ f(x) $.

If $ f(x_n) $ isn't constant for infinitely many $ n $, we can find a subsequence $ x_{n_k} $ such that $ f(x_{n_k}) $ is strictly increasing or decreasing. Hence, $ f(x_{n_k}) $ cannot converge to $ f(x) $ nor to $ f(x_{n_k}) $ for any $ k $. $ \{ x_{n_k} \} \cup \{ x \} $ is compact, but $ \{ f(x_{n_k}) \} \cup \{ f(x) \} $ is not, which gives a contradiction, since $ f $ preserves compactness.

If $ f(x_n) = c $ for infinitely many $ n $, we can assume it's constant for all $ n $, going to a subsequence if necessary. $ f $ preserves connectedness, so for arguments between $ x $ and $ x_n $ it takes all values between $ f(x) $ and $ c $. For each $ n $ take $ y_n $ between $ x $ and $ x_n $ so that $ 0 < |f(y_n) – c| < \frac{1}{n} $. $ \{y_n\} \cup \{x\} $ is compact, but the image is not, since $ f(y_n) \rightarrow c \ne f(x)$. Contradiction.

Best Answer

You definitely need the target space to be Hausdorff. Theorem $\mathbf{5.4}$ of Gerlits, Juhász, Soukup, & Szentmiklóssy, Characterizing continuity by preserving compactness and connectedness, says that if $X$ is $T_3$, and every connectedness-preserving, compactness-preserving map from $X$ to a $T_1$ space is continuous, then $X$ is discrete. Thus, there must be a $T_1$ space $Y$ and a connectedness-preserving, compactness-preserving map $f:\Bbb R\to Y$ such that $f$ is not continuous. In fact, let $Y$ denote $\Bbb R$ with the cofinite topology, and define

$$f:\Bbb R\to Y:x\mapsto\begin{cases} 1,&\text{if }x=2^{-n}\text{ for some }n\in\Bbb N\\ x,&\text{otherwise}\;. \end{cases}$$

Then $f$ is not continuous, since the inverse image of $\{1\}$ is not closed in $\Bbb R$. $Y$ is hereditarily compact, so $f$ certainly preserves compactness. Finally, if $C\subseteq\Bbb R$ is connected, then either $|C|=1$, in which case $f[C]$ is connected, or $C$ contains a non-empty open interval, in which case $f[C]$ is infinite and therefore connected.

The positive result closest to what you want is Corollary $\mathbf{2.4}$ of the same paper, which says that if $X$ is locally compact, locally connected, and monotonically normal, and if $f$ is a connectedness-preserving, compactness-preserving map from $X$ to a $T_3$ space, then $f$ is continuous.