Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Before we start, I'm aware the result is true for when the function is a map between Euclidean spaces. In fact, with a minimal amount of extra work we can see that a function between locally-compact, locally-connected topological spaces which preserves connected and compact subsets is in fact continuous.

My question is for an example of a function which preserves compact and connected subsets but is not continuous. I've found a minimal example with the two point space and the identity function where the Sierpinksi space is the domain and the image space has the discrete topology. Now I want something a little more interesting. Can anyone come up with an example where the domain and codomain are Hausdorff?

share|cite|improve this question
You might want to see: – Zircht Feb 12 '14 at 0:47
up vote 6 down vote accepted

If a function $f:X\to Y$, between any topological spaces, has finite image, then it maps any set in $X$ to a compact set in $Y$, and in particular thus it preserves compactness. Further, if $X$ is totally disconnected, so every connected component is a singleton, then the image of $f$ on any connected set in $X$ is a singleton too, and thus connected in $Y$. So, for such $X$, any function preserves connectivity.

So, you now get a huge class of compactness and connectivity preserving functions $f:X\to Y$ which are not continuous. Simply take $X$ to be totally disconnected (e.g., $X=\mathbb Q$ with the usual topology (so in particular, $X$ is Hausdorff)) and take $Y$ to be arbitrary (e.g., $Y=[0,1]$, so it's Hausdorff). Now just let $f:X\to Y$ attain finitely many values, while not being continuous. There are plenty of such functions.

share|cite|improve this answer
What if $X$ is connected and $f(X)$ is connected and not constant? I $f$ necessarily continuous? – Gary. Aug 22 '15 at 2:08

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.