I am trying to solve Exercise 2 (Section 4.1.6, Page 129) from Robert Magnus "Metric Spaces: A Companion to Analysis". I have tried to prove item (a), but I am a unsure on how to approach parts (b) and (c).
(a) Let $A$ be a sequentially compact set in a metric space. Let $x \notin A$. Show that there exists $y \in A$ such that $d(x, y) = \operatorname{dist}(x, A)$.
Attempt: If $A$ is a sequentially compact set and if $x \notin A$, then recall that $\operatorname{dist}(x, A) = \inf_{y \in A} d(x, y)$. So there exists a sequence $(y_n) \in A$ such that $d(x, y_n)$ converges to $\operatorname{dist}(x, A)$. Since $A$ is sequentially compact, then $(y_n)$ contains a convergent subsequence $(y_{n_k})$ with limit $y \in A$. Therefore, $d(x, y) = \lim_{k \to \infty} d(x, y_{n_k}) = \operatorname{dist}(x, A)$.
(b) Show that the result of item (a) still holds if $X = \mathbb{R}^n$ and $A$ is an unbounded closed set in $\mathbb{R}^n$, even though in this case $A$ is not sequentially compact.
(c) The result of item (a) may fail if $A$ is closed but not sequentially compact. Find an example in which $X$ is a subspace of $\mathbb{R}$.
Is there a specific approach to prove item (b) and what example may I consider for part (c)? Also, is my proof for (a) correct? Appreciate the help.
Your proof for $(a)$ is correct.
For $(b)$ I would hint that you can reduce to the case where $A$ is bounded (hence compact, sequentially compact) by somehow ignoring all the irrelevant points of $A$. Morally, the fact $A$ is closed is what counts. And closed in $\Bbb R^n$ too, so, somehow, it is "actually" closed, unlike the weird examples in $(c)$.
For $(c)$, the real issue is that $A$ being bounded and closed doesn't necessarily imply $A$ is compact, if you restrict to subspaces of $\Bbb R^n$. For example, you know that $(0,1]$ is closed in $(0,\infty)$ but there is a compactness problem at zero. Can you use the issue at zero to find some suitable $X\supseteq(0,1]$ and some suitable $x\in X$ whose distance from $(0,1]$ is not attained?