
So limit goes to infinity, and I have to show that there exists a finite infimum. how do i show this?

So limit goes to infinity, and I have to show that there exists a finite infimum. how do i show this?
Think of a chain you hold by both ends very high. It has to ''drop down'' somewhere. That's roughly the idea.
So let's hold that rope ''very high''. For every $M > 0$, there exists $K > 0$ such that for every $x > K$, $f(x) > M$ and for every $x < -K$, $f(x) > M$ ; in other words, for every $x$ satisfying $|x| > K$, $f(x) > M$. Assuming $M$ is large enough so that $f^{-1}(]-\infty,M])$ is non-empty, then we know the infimum of $f$ is inside $[-K,K]$ because outside this interval, $f(x) > M$.
Now $[-K,K]$ is a compact interval. Since $f$ is continuous we can find the minimum on it. :)
For the example of the function $g$, you have very simple examples : for instance, take
$$ g(x) \overset{def}= \begin{cases} -x-2 & \text{ if } x < -1 \\ \\ \frac 1x & \text{ if } 0 < |x| < 1 \\ \\ 0 & \text{ if } x = 0 \\ \\ x & \text{ if } x > 1. \end{cases} $$ I'm basically just taking what happens with $\frac 1x$, satisfying your conditions, and then "holding the function with a rope" (the two linear parts).
Hope that helps,
Hint: On each $[-n, n]$, the function attains a minimum, since $[-n, n]$ is compact and $f$ is continuous.
Since $f(x) \to \infty$ as $x \to \pm \infty$, there exists an $N$ such that
$$|x| > N \implies f(x) > f(0)$$
Can you combine these two facts?