If $f$ is continuous $\displaystyle\lim_{x \to \infty}f(x)=\infty$ iff $f^{-1}(K)$ is compact for every compact $K \subset \mathbb{R}^{n}$. 
Let $f: \mathbb{R}^{m}\to \mathbb{R}^{n}$ be a continuous function. Prove that the following statements are equivalents:
(i) $\displaystyle\lim_{x \to \infty}f(x)=\infty$;
(ii) $f^{-1}(K)$ is compact for every compact $K \subset \mathbb{R}^{n}$.

My attempt.
(i) $\Longrightarrow$ (ii): If $K \subset \mathbb{R}^{n}$ is compact, $f^{-1}(K)$ is closed, since $f$ is continuous. If $f^{-1}(K)$ is unbounded, there is a sequence $(x_{n}) \subset f^{-1}(K)$ such that $x_{n} \to \infty$.
I want to conclude that $f(x_{n}) \to \infty$. How can I ensure it?
(ii) $\Longrightarrow$ (i): I dont have a good idea. Can someone help me? I want just a hint, not a solution.
 A: To complete  your argument for $(i)$ $\|x_n\|\rightarrow \infty$ implies that $f(x_n)\rightarrow \infty$ by hypothesis.
ii)   implies i)Suppose that there exists a sequence $x_n$ such that $lim_n\|x_n\|=\infty$ and $f(x_n)$ is bounded, $f(x_n)$ is contained in a closed ball $B$ which is compact, so $f^{-1}(B)=C$ is compact, and bounded by hypothesis, but $x_n\in C$ contradiction since $x_n$ is not bounded.
A: Regarding (ii) $\Longrightarrow$ (i)
Take $p \in \mathbb N$. You want to find $M>0$ such that for $\Vert x \Vert >M$ you have $\Vert f(x) \Vert >p$.
The closed ball $K_p$centered on zero with radius $p$ is a compact subset of $\mathbb R^n$. $f^{-1}(\mathbb R^n \setminus K_p) = f^{-1}(\mathbb R^n)\setminus f^{-1}(K_p)$. And $f^{-1}(K_p)$ is by hypothesis a compact subset of $\mathbb R^n$, therefore bounded and included in a closed ball centered on zero with a radius $M>0$.
Where are done: the image of a point $x$ with a norm $>M$ is such that $\Vert f(x)\Vert >p$.
A: The definition of $x_n\to\infty$ I am used to is that for every compact set $K$ there exists $N$ such that for all $n>N$ we have $x_n\not\in K$. So then the statement $$\lim_{x\to\infty}f(x)=\infty$$ would literally mean that for every compact set $K$ there exists compact set $L$ such that for all $x\not\in L$ we have $f(x)\not\in K$, so $f^{-1}(K)\subseteq L$.
I would like to mention how this elegant definition can be made precise with topology. In topology we say that $x_n\to x$ if for every open set $U$ containing $x$ there exists $N$ such that for all $n>N$ we have $x_n\in U$. There is also a thing in topology called the one-point compactification of a topological space $X$. The idea is to add a "point at infinity", so you get $X\cup\{\infty\}$, and the open sets containing $\infty$ are exactly the complements of the compact sets in $X$.
