There was a problem of metric space which I recently found. It is as follows:
Suppose $X$ is a metric space with finitely many isolated points and having the property that every real value continuous function on $X$ is uniformly continuous.Then show that $X$ is compact.
I have no idea of how to proceed further.Can someone help me to work it out?
SKETCH: Let $\langle X,d\rangle$ be a metric space with only finitely many isolated points, and suppose that $X$ is not compact.
For each $n\in\Bbb Z^+$ let $D_n=\{x_k\in D:k>n\}$.
$$\operatorname{cl}B(x_k,r_k)\cap\left(D_k\cup\bigcup_{\ell<k}\operatorname{cl}B(x_\ell,r_\ell)\right)=\varnothing\text{ and }r_k\le\frac1k\;.$$
Now let $U=\bigcup_{k\in\Bbb Z^+}B(x_k,r_k)$; $U$ is an open nbhd of $D$, so $D$ and $X\setminus U$ are disjoint closed sets. Define a function
$$f:D\cup(X\setminus U)\to\Bbb R:x\mapsto\begin{cases} n,&\text{if }x=x_n\\ 0,&\text{if }x\in X\setminus U\;. \end{cases}$$
By the Tietze extension theorem there is a continuous $F:X\to\Bbb R$ that extends $f$, i.e., such that $F\upharpoonright\big(D\cup(X\setminus U)\big)=f$.