If $K$ is a subset of metric space $\mathbb{R}^n$ and if every real valued continuous function on $K$ is bounded, then $K$ is compact.
I know a proof considering $K$ is unbounded and not closed. This is proof by contradiction.
Is there any direct way to prove?
Please help!