If $f$ goes to infinity, prove it has a minimum The question is:

$f: A\to R$ is a continuous, real-valued function, where $A\subseteq\mathbb{R}^n$.
If $f(x)\to\infty$ as $\|x\|\to\infty,$ show that $f$ attains a minimum.

Where I’ve gotten so far is I’ve written down the definition of this limit, and that tells that for all $M > 0$, there exists some $L > 0$ such that if $\|x\| > L$, then $f(x) > M$.
I can kind of see that this means that I need to take some $[-L, L]\subseteq A$ and use E.V.T. for compact sets here, and prove that $f(x)$ needs to be larger in $[-L, L]^c$, but I’m not really sure how to actually do any of that. Any help would be greatly appreciated.
 A: The result is false without further hypothesis on $A$. For example if $n=1$ and $A=\mathbb Q \subset \mathbb R$, then the map $f(x)=(x-\sqrt 2)^2$ satisfies the hypothesis of the question, but has no minimum.
Suppose that $A= \mathbb R^n$. Then according to the hypothesis on the limit of $f$ at $\infty$, it exists $R \gt 0$ such that for $\lVert x \rVert \ge R$, we have $\lvert f(x) \rvert \ge \lvert f(0) \rvert + 1$. On the compact disk $D$ centered on the origin and of radius $R$, $f$ is bounded and attains its minimum as it is supposed to be continuous. This minimum is also a global minimum.
A: If $f$ is continuous on $\mathbb{R}^n$ then the claim is true.
It suffices to show that there exists a compact set $K$ such that
$$\inf_K f = \inf_{\mathbb{R}^n} f$$.
Indeed, then one can apply the extreme value theorem on $K$.
However, if there does not exist such $K$ for the above statement, it means that one can find a sequence $x_n$ with $\|x_n\|_ \to \infty$ but $f(x_n) \not \to \infty$. (For instance consider the ball of radius $r_n \to \infty$.)
