Claim: A topological space $\,X\,$ is compact iff it has the Finite Intersection Property (=FIP):
Proof: (1) Suppose $\,X\,$ is compact and let $\,\{V_i\}\,$ be a family of closed subsets s.t. $\,\displaystyle{\bigcap_{i}V_i=\emptyset}\,$. Putting now $\,A_i:=X-V_i\,$ , we get that $\,\{A_i\}\,$ is a family of open subsets , and
$$\bigcap_{i}V_i=\emptyset\Longrightarrow \;X=X-\emptyset=X-\left(\bigcap_iV_i\right)=\bigcup_i\left(X-V_i\right)=\bigcup_iA_i\Longrightarrow\;\{A_i\}$$
is an open cover of $\,X\,$ and thus there exists a finite subcover of it:
$$X=\bigcup_{i\in I\,,\,|I|<\aleph_0}A_i=\bigcup_{i\in I\,,\,|I|<\aleph_0}(X-V_i)=X-\left(\bigcap_{i\in I\,,\,|I|<\aleph_0}V_i\right)\Longrightarrow \bigcap_{i\in I\,,\,|I|<\aleph_0}V_i=\emptyset\Longrightarrow$$
The family $\,\{V_i\}\,$ has the FIP.
(2) Suppose now that every family of closed subsets of $\,X\,$ hast the FIP, and let $\,\{A_i\}\,$ be an open cover of it. Put $\,U_i:=X-A_i\,$ , so $\,U_i\, $ is closed for every $\,i\,$:
$$\bigcap_iU_i=\bigcap_i(X-A_i)=X-\bigcup_i A_i=X-X=\emptyset$$
By assumption, there exists a finite set $\,J\,$ s.t. $\,\displaystyle{\bigcap_{i\in J}U_i=\emptyset}\,$ , but then
$$X=X-\emptyset=X-\bigcap_{i\in J}U_i=\bigcup_{i\in J}X-U_i)=\bigcup_{i\in J}A_i\Longrightarrow$$
$\,\{A_i\}_{i\in J}$ is a finite subcover for $\,X\,$ and thus it is compact....QED.
Please be sure you can follow the above and justify all steps. Check where we used Morgan Rules, for example, and note that we used the contrapositive of the FIP's definition...
Best Answer
This was tricky! The idea, is you can't think of the sets as intervals. As there are not two intervals for which this is true.
Consider $A = \{2,3,4,5, \ldots\}$. This is a closed set. Consider $B =\{2+1/2, 3+1/3, 4+1/4, 5+1/5, \ldots\}$. This is also a closed set.
Now, $A$ and $B$ are clearly disjoint and for $n \ge 2$, we have that $n \in A$ and $n + 1/n \in B$. Thus the distance between these points is $1/n$. This is true for all integers $n \ge 2$ and hence they have distance $0$ between the sets.