$f$ is convex and $dom(f):x \in \mathbb{R}^N$. Define sublevel sets of $f$ as
\begin{equation} \mathbf{S}(f,\beta)=\{x \in \mathbb{R}^N\ : f(x) \leq \beta \} \end{equation}
are compact.
I need to prove that if $f$ is a convex function, then having compact sublevel sets is same as being coercive: for every sequence $\{x_k\}\subset\mathbb{R}^N$ with $\|x_k\|_2 \rightarrow \infty$, we have $f(x_k) \rightarrow \infty$.
How can I use the definition of sub level sets to prove this. Any help will be much appreciated.