Openness and closedness depend on the subspace, but compactness does not.
$[0,1)$ is an open set in $[0,+\infty)$; and $(0,1]$ is a closed set in $(0,+\infty)$.
This often gives me an incorrect impression that compactness also depends on the subspace.
In fact, for $K \subset A \subset B$, $K$ is compact in $A$ iff $K$ is compact in $B$ (assuming subspace topology).
Intuition: $K$ is compact in any ambient space iff if $K$, itself, is a compact topological space when endowed with the subspace topology. Clearly, whether viewed as a subset of $A$ or $B$, $K$ remains the same topological space. In this sense, compactness is somehow intrinsic.
Categories:
Topology