How to show that if $A$ is compact, $d(x,A)= d(x,a)$ for some $a \in A$? I really think I have no talents in topology. This is a part of a problem from Topology by Munkres:

Show that if $A$ is compact, $d(x,A)= d(x,a)$ for some $a \in A$. 

I always have the feeling that it is easy to understand the problem emotionally but hard to express it in math language. I am a student in Economics and I DO LOVE MATH. I really want to learn math well, could anyone give me some advice. Thanks so much!

Hints:
(1) By definition of distance between points and set:
$$D:=d(x,A):=\inf_{a\in A}d(x,A)$$
(2) By definition of infimum:
$$\forall\,n\in\Bbb N\;\exists\,a_n\in A\;\;s.t.\;\;D\le d(x,a_n)\le D+\frac1n$$
(3) The sequence $\,\{a_n\}\,$ has a subsequence 
$$\,\{a_{n_k}\}\;\;s.t.\;\;a_{n_k}\xrightarrow[k\to\infty]{}a\in A$$
(4) The function distance $\,d(x,.): X\to\Bbb R_+\;$ from a metric space $\,X\,$ is continuous 
