Let $(X,\rho)$ be a metric space. Show that $\rho(x,E) > 0 $ where $E$ is compact and $x \notin E $
I dont think we can assume that $E$ is closed since this is a arbitrary metric space.
My attempt
1) consider $f(x) = \inf\{\rho(x,y): y \in E\}$. Then by extreme value theorem $f(x) \geq 0$. How to show that $f(x) \neq 0$.
Any other method is also welcome