# Counterexamples to: If $f:X \to Y$ is continuous, $Y$ is compact, then $f^{-1}$ is continuous.

It is a theorem that if $$f:X \to Y$$ is a continuous bijection, $$X$$ is compact, then $$g = f^{-1}$$ is continuous. My professor asked us to find a counterexample to

If $$f:X \to Y$$ is continuous, $$Y$$ is compact, then $$g = f^{-1}$$ is continuous.

I do not like my counterexample so much because it uses the discrete metric. Are there other counterexamples?

My Counterexample: Let $$X = [0, 1]$$ with the Discrete metric, $$Y = [0, 1]$$ with the Euclidean metric, and let $$f$$ be the identity function.

• @MariosGretsas Ah sorry I forgot to add that. I don't like my counterexample so much because it uses the discrete metric. Do you know of other counterexamples? – Ovi Dec 9 '19 at 18:33
• The smallest example seems to be the identity $f:X\to Y$ with $X=Y=\{1,2\}$, but $X$ with the topology $\{\emptyset, \{1\}, X\}$ and $Y$ with the topology $\{\emptyset, Y\}$. – topeik Dec 9 '19 at 18:36
• @Ovi why not?? you counterexample is fine..if the inverse function was continuous then $f$ would be a homeomorphism which is not the case here, since the metric spaces in your example are not homeomorphic..one is compact and the other is not. – Marios Gretsas Dec 9 '19 at 18:38
• If $f$ is a bijection, you can always identify $X$ and $Y$ as sets. Then $f$ being continuous corresponds to the $X$-topology being finer than the $Y$-topology. The inverse not being continuous then means it's strictly finer. Thus all examples are akin to yours, but of course one doesn't need to go the whole way to use the finest topology of all on $X$. Take $X = Y = [0,1]$, the standard topology on $Y$, the lower limit topology on $X$ for example. – Daniel Fischer Dec 9 '19 at 18:52
• See my answer to a similar question for a simple counter-example. – TonyK Dec 9 '19 at 19:17

Your example is fine. Another example is to take $$X=[0,2\pi)$$ with the usual metric, and let $$Y=S^1 = \{z\in\mathbb{C}\mid |z|=1\}$$, the unit circle on the complex plane, with the usual metric (so the distance is measured on the plane, not along the circle).
Let $$f\colon X\to Y$$ be given by $$f(x) =e^{ix} = \cos(x) + i\sin(x)$$.
Now, $$Y$$ is closed and bounded, so it is compact. The function $$f$$ is a continuous bijection. But $$f^{-1}$$ is not continuous; if it were, then $$f$$ would be a homeomorphism, but removing a single point from $$X$$ (other than $$0$$) will disconnect $$X$$, and removing a single point from $$Y$$ does not. Alternatively, note that you cannot find a neighborhood of $$1\in Y$$ whose image lies inside the neighborhood $$[0,\frac{1}{2})$$ of $$f^{-1}(1)=0$$, since the image will contain points arbitrarily close to $$2\pi$$.