In Rudin's Analysis, we have
Theorem: Compact subsets of metric spaces are closed.
Can't I generate a counterexample?
$\mathbb R$ is a metric space. $(0,1)\in\mathbb R$ is a subset which is also compact since I can cover $(0,1)$ with the open set $(-1,2)$. $(0,1)$ is also not closed because $1$ is a limit point (all neighborhoods of $1$ contain a point which is in $(0,1)$) but not in the set.
So $(0,1)$ is a non-closed subset of $\mathbb R$ with a finite open covering, and thus compact.
This book is tough for me, I'd appreciate any help.