Compact sets (involving open and closed sets)

How can an open set be compact? From what I understand, a compact set must be closed and bounded.

Also, is the following statement true or false?

Every subset of a metric space that is not closed, is not compact

I believe it's a true statement because a compact set must be closed.

• All of this depends on the topology. Also recall that a set can be both closed and open. It is true that, in a metric space, a compact set must be closed. That doesn't mean it can't be open. – Randall May 2 at 15:49
• Look up the definition of "topological space". You will see that it's not very restrictive. Hausdorff ($T_2$) spaces are certain kinds of topological spaces. Metric spaces are certain kinds of Hausdorff spaces. Compact subsets of a Hausdorff space must be closed. – DanielWainfleet May 2 at 17:39

For example, consider the topological space $$X = [0,1] \cup [2,3]$$, equipped with the subspace topology relative to the whole real line.
In this space $$X$$, its subspace $$[0,1]$$ is compact (because the subspace topology of $$[0,1]$$ relative to $$X$$ is identical to the subspace topology of $$[0,1]$$ relative to the real line).
On the other hand, $$[0,1]$$ is an open subset of $$X$$ (because it is the intersection of $$X$$ with $$(-1/2,3/2)$$ which is an open subset of the real line). As it turns out, $$[0,1]$$ is also a closed subset of $$X$$. So, it is both closed and open in $$X$$ (but it is not open in the real line, of course).