Let $A$ and $B$ be two nonempty disjoint subsets of $\mathbb{R}^{n}$. Put $d(A,B)=inf\left \{ ||a-b||:a\in A, b\in B \right \}$.
a) Show that if one of the sets $A$ and $B$ is compact then $d(A,B)>0$.
b) Let $n=2$, $A=\left \{ (x,1/x):x>0 \right \}$ and $B=\left \{ (x,0):x>0 \right \}$. Show that the sets $A$ and $B$ are closed in $\mathbb{R}^{2}$, $A\cap B=\emptyset$ but $d(A,B)=0$.
My thoughts: Let $A$ be compact then it is not only closed but also bounded. Assume $d(A,B)=0$, so $inf||a-b||=0$. So $a=b$ for some $a$ and $b$. (I think $A$ and $B$ being closed is the reason of that, but I'm not sure how to show this.) but that contradicts the fact that the sets are disjoint.
for part b:$ d(A,B)=\sqrt{((x-x)^{2}+(1/x)^{2})}$, as $x$ increases distance decrases, since $lim_{x\rightarrow \infty}(1/x)^{2}=0$, $d(A,B)=0$. For showing their intersection is an empty set $1/x\neq 0$ if $x\in \mathbb{R}$. I need to show every convergent sequence converges to a point in the sets, for showing $A$ and $B$ are closed, but I couldn't find how to.