SKETCH: Let $\langle X,d\rangle$ be a metric space with only finitely many isolated points, and suppose that $X$ is not compact.
- Show that $X$ has a countably infinite closed, discrete subset subset $D=\{x_n:n\in\Bbb Z^+\}$.
For each $n\in\Bbb Z^+$ let $D_n=\{x_k\in D:k>n\}$.
- Recursively construct pairwise disjoint open balls around the points of $D$ as follows. First, there is an $r_1>0$ such that $\operatorname{cl}B(x_1,r_1)\cap D_1=\varnothing$ and $r_1\le 1$. Then there is an $r_2>0$ such that $\operatorname{cl}B(x_2,r_2)\cap\big(\operatorname{cl}B(x_1,r_1)\cup D_2\big)=\varnothing$ and $r_1\le\frac12$. In general, at stage $k$ we choose $r_k>0$ such that
$$\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}$$
- Show that $f$ is continuous.
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$.
- Show that $F$ is not uniformly continuous.