Existence of points Be $X, Y$ two closed subspaces of $\mathbb{R}^n$ with $X$ bounded. Show the existence of points $x_0 \in X, y_0 \in Y$ such as $d(x_0,y_0) = d(X,Y)=\inf_{x \in X, y \in Y} d(x,y)$.
My idea so far: I want to start by showing that $X_r = \{ y \in  \mathbb{R}^n | d(y,X) \leq r\}$ is compact. With this subspace, without losing generality, I would replace $Y$ by $Y \cap X_r$ for $d(X,Y) \leq r$ where the intersection is nonempty.
 A: Hints:
$1).\ $ There are sequences $(x_i), (y_i)$ such that $d(x_i,y_i)\to d(X,Y):= m$
$2).\ X$ is compact so there is a convergent subsequence of $(x_i)$ which you may still call  $(x_i)$ for convenience. $(x_i)\to p\in X$
$3).\ $ You may assume that $d(x_i,y_i)\le m+1$ and that $\|x_i\|<R<\infty.$  (Why?).
$4).\ $ Show therefore that $(y_i)$ is bounded and so has a convergent subsequence, which we still call $(y_i)$. Then, $(y_i)\to q\in Y$
$5).\ $ Combine $2$ and $4$ to show that there is a subsequence $(x_{n_k}-y_{n_k})$ that converges to $p-q$ and $p\neq q.$
$5).\ $ Conclude that $d(x_{n_k},y_{n_k})\to p-q=m.$
A: We can assume that $X$ and $Y$ are disjoint. Suppose that $Y$ is bounded. Then, both $X$  and $Y$ are compact, and the result is obvious: Take a sequence $(x_n, y_n)$ in $XxY$ such that $d(x_n,y_n)$ converges to $D=d(X,Y).$ Then, $x_0=\lim x_n$ and $y_0 = \lim y_n.$
Now consider the original question.  Let $C\in X$ satisfy $d(C,Y)\le 2D$ and let $Y_1=Y\cap B,$ where $B$ is the ball of center $C$ and radius $4D.$  Clearly, $d(X,Y)=d(X,Y_1).$  Since $Y_1$ is closed and bounded, we have reduced to the case solved in the first paragraph.
A: If you can show / have shown that $d(x,y) : \mathbb{R}^n \times \mathbb{R}^n \to \mathbb{R}$ is continuous, then you can see this result follows from the fact that a continuous function on compact set attains its extreme values.
Simple case: Assume $X, Y$ are compact. Then $X \times Y$ is compact, and $d(x,y)$ is continuous on this subset. Thus, it attains a minimum at some $(x_0, y_0)$, i.e. there exists $x_0, y_0$ such that
$$d(x_0, y_0) = \inf_{x \in X, y \in Y} d(x,y).$$
Now, in your case $X$ is closed and bounded in $\mathbb{R}^n$, hence is compact. However, $Y$ is closed but might not be compact. We just need to replace $Y$ by a compact subset. Intuitively, we can disregard points in $Y$ that could not possibly help us attain the infimum. Thus, let $m = \inf_{x \in X, y \in Y} d(x,y)$, and define
$$ Y' = \{ y \in Y : d(X, y) \le m + 1 \} .$$
Taking closure of $Y'$ if necessary, we can assume that $Y'$ is closed.
Because $X$ is bounded, you can easily show $Y'$ is bounded.
Thus, $Y'$ is closed and bounded, hence compact.
Furthermore, note that $\inf_{x \in X, y \in Y} d(x,y) = \inf_{x \in X, y \in Y'} d(x,y)$. Thus, without loss of generality, we can replace $Y$ by $Y'$, and then apply the simple case.
