# An exercise of metric spaces in a continuous space

Is my work correct?

Could they give me another counterexample?

-
What exactly is the problem? I think you are missing something here. –  copper.hat Jun 1 '12 at 5:51
A counterexample to what? –  Chris Eagle Jun 1 '12 at 10:05
The question Is my work correct? is sweet since the amount of mathematical work shown by the OP is null. –  Did Jun 3 '12 at 8:29

If the missing conclusion of the theorem at the top is that $h$ is continuous iff $f$ is continuous, then yes, the example in (c) shows that compactness of $Y$ cannot be omitted from the hypothesis. There is a small error, though: $g\circ f$ is the identity on $[0,2\pi)$, not $[2\pi,0)$.
There are many similar examples; here is what is perhaps the simplest. Let $$X=Z=\{0\}\cup\left\{\frac1n:n\in\Bbb Z^+\right\}$$ and $Y=\Bbb N$, all with the usual Euclidean metric given by $d(x,y)=|x-y|$. $X$ is compact, but $Y$ isn’t. Let $$f:X\to Y:x\mapsto\begin{cases}0,&\text{if }x=0\\\\\frac1x,&\text{if }x\ne0\;,\end{cases}$$ and let $$g=f^{-1}:Y\to X:n\mapsto\begin{cases}0,&\text{if }n=0\\\\\frac1n,&\text{if }n\in\Bbb Z^+\;.\end{cases}$$
Then $g$ is one-to-one and continuous, and $g\circ f$ is the identity map on $X$, but $f$ is not continuous at $0$.
Small correction/typo: $f$ should be $\frac{1}{n} \mapsto n$. –  Tom Cooney Jun 1 '12 at 9:31
@Tom: Thanks; fixed. (Actually, I reversed $f$ and $g$.) –  Brian M. Scott Jun 1 '12 at 9:36