In a metric space, an open set contains a small ball around each of its points. The interior consists of such points; the closure includes all limit points; the boundary is closure minus interior. Open and closed are not mutually exclusive labels; the empty set and the whole space are both. In R, the set [0,1) has interior (0,1), closure [0,1] and boundary {0,1}.
In a subspace X, an open set has the form X intersected with an ambient open set. Thus [0,1) is open relative to [0,2], using intersection with (-1,1), although it is not open in R. A set may also be relatively closed without being closed in the ambient space. Always state which space defines neighbourhoods and which metric is used.
Compactness means every open cover has a finite subcover. In Euclidean R^n, Heine–Borel makes this equivalent to closed and bounded. In a metric space, compactness is equivalent to sequential compactness; completeness and boundedness alone do not suffice in arbitrary metric spaces. A continuous image of a compact set is compact, giving attained maxima and minima for real continuous functions on a nonempty compact domain.
Connected sets cannot be separated into two disjoint nonempty relatively open parts; connected subsets of R are precisely intervals. A continuous image of a connected set is connected, which yields the intermediate value theorem. Path connectedness implies connectedness, but not conversely in every space. A compact set need not be connected, and a connected set need not be compact; a finite two-point set and an open interval supply the contrasting cases.