Examine $\ell=\inf_{x\in A} f(x)$. We know $\ell \ge 0$, because $f(x)\ge 0$ always. We need to show that $f$ attains its infimum. Here's a sketch of how: let $(x_n)$ denote a sequence of elements in $A$ so that $f(x_n)\to \ell$ (why does such a sequence exist?). In particular, we see that $\lVert x_n-x_0\rVert \le\ell+\varepsilon$ for $n$ sufficiently large, so that the sequence is eventually contained in a compact neighborhood of $x_0$, and so up to passing to a subsequence, we may assume it converges.
So, $(x_n)\to x_\infty$, a limit point. Now, $x_\infty\in A$, because $A$ is closed. By continuity of $f$ (justify!), we see that $f(x_\infty)=\ell$ (justify!), and so $f$ attains its minimum on $A$.