# Question about the proof of compact subsets of metric spaces are closed and bounded.

If $A$ is a compact subset of a metric space $(X,d)$ then A is closed and bounded.

What I'm confused about is this part of the proof:

Let $x_0$ be fixed and define the mapping $f:(A,T) \rightarrow \Bbb R$ by $f(a) = d(a,x_0)$ for all $a \in A$, where $T$ is the induced topology on A. Then $f$ is continuous.

How is f continuous?

• Have you tried to prove that $f$ is continuous? The proof is pretty straightforward. – Brian M. Scott Jun 1 '16 at 17:46
• I wonder if the confusion is the notation $f:(A,T)\rightarrow\mathbb{R}$. I would be more comfortable with $f:A\rightarrow\mathbb{R}$, else, you seem to have a function that can change with changing topologies, and you would need some notation of distance between topologies. ("As topology $T_1$ approaches topology $T_2$, $f(a,T_1)\rightarrow f(a,T_2)$" is not really what is wanted for this problem). – Michael Jun 1 '16 at 17:50
• @BrianM.Scott I've tried with every open set in $\Bbb R$ has an inverse image in $T$ but I'm confused. $(\forall (c,d) \in T_{Euclidean})(f^{-1}((c,d)) \in T)$ So I have to show that $f^{-1}((c,d)) = B_r(z)$. I know that $f^{-1}((c,d)) = \{x:x \in A$ and $f(x) \in (c,d) \}$. But from here I can't figure out how to relate this to the metric required for the open ball. – Oliver G Jun 1 '16 at 17:53

$|f(a)-f(b)|= |d(x_0,a)-d(x_0,b) | \le d(a,b)$
• To the OP : If $J =(p,q)$ is an open real interval then $f^{-1}J= A\cap \{x\in X | p$ $<d(a_0,x)<q\}$ which is the intersection of $A$ with an open subset of $X.$... BTW there are other proofs that do not involve functions. – DanielWainfleet Jun 1 '16 at 18:05