Coercive continuous function on a closed subset has a global minimum proof I would like to ask for help with the proof of the following proposition:
Let f be a real continuous function, defined on a closed set $X \subset \mathbb{R}^n$, which is coercive, i.e. for every sequence $\{x_n\}_{n=1}^\infty$ with $||x_n|| \to \infty$ we have $f(x_n) \to +\infty$. Then $f$ achieves global minimum on $X$. 
My idea for a proof:
If $X$ is bounded we are done by the Weierstrass extreme value theorem. But we only have closeness. So let $f^* = \inf\limits_{x\in X}f$ which is achieved at $x^*$ for which we don't know if $x^* \in X$. Let $Y$ be the closed ball of radius $||x^*||+1$. It surely contains $x^*$ and is bounded and so is
$$
Z = X \cap Y \subset Y 
$$
Now we know that $Z$ is compact and $f$ achieves its minimum there. But are we sure (and if yes, why) that this minimum is actually $f^*$ and thus $x^* \in X$?

Let choose any point in $X$, call it $x_0$.
Since $f$ is coercive, then $\exists k>0\mid ||x||\ge k\implies f(x)\ge1+f(x_0)$.
Note: this is a simple way to guarantee that $f(x)>f(x_0)$. It is not a restriction since coercivity allows to find $k$ for any $A$, in particular $A=f(x_0)+1$.

Now $K=X\cap \overline{B(0,k)}$ is compact (since $X$ is closed and closed ball compact) so $f$ reaches a minimum in $x^*\in K\subset X$.
Also $x_0\in K$ else $||x_0||>k\implies f(x_0)\ge 1+f(x_0)$ which is a contradiction. 
In particular $f(x^*)\le f(x_0)$.

Yet $\forall x\in X\setminus K$ we have $||x||>k$ so $f(x)\ge 1+f(x_0)>f(x_0)\ge f(x^*)$ 
So $x^*$ is a global minimum for $f$ on all $X$.
