Compact sets of metric spaces are closed? I am struggling with the idea that all compact subsets of a metric space are closed after reading chapter 2 of Rudin's Principles of Mathematical Analysis. 
The reason I am confused is that it seems unreasonable that a compact subset must be closed. If we were to take an open subset $K$ of a compact subset $Y$ in a metric space $X$, where $K$ is open relative to $X$, then every finite subcover of $Y$ would also be a finite subcover of $K$. But then, $K$ would be both compact and open in $X$, which contradicts the theorem that all compact subsets in $X$ are closed. 
Could someone please explain to me why my reasoning is incorrect and how it is  that compact subsets of metric spaces must be closed?
Thank you,
Evan

The problem with your reasoning is that $K$ may have an open cover $\mathscr{U}$ that does not arise from an open cover of $Y$, so that compactness of $Y$ doesn’t tell you anything about $\mathscr{U}$.
It’s easiest, I think, to prove the contrapositive: if $A\subseteq X$ is not closed, then $A$ is not compact. Let $\langle X,d\rangle$ be a metric space, and suppose that $A\subseteq X$ is not closed. Then there is a point $p\in(\operatorname{cl}A)\setminus A$. For $n\in\Bbb Z^+$ let $$U_n=\left\{x\in X:d(x,p)>\frac1n\right\}\;,$$ and show that $\{U_n:n\in\Bbb Z^+\}$ is an open cover of $A$ with no finite subcover. 
