Suppose that $f: \Bbb R \longrightarrow \Bbb R$ is continuous on $\Bbb R$ and $\displaystyle \lim_{x \to -\infty} f(x) = 0$ and $\displaystyle \lim_{x \to \infty} f(x) = 0$. Prove that $f$ is bounded on $\Bbb R$ and attains either a maximum or a minimum on $\Bbb R$. Give an example to show that both a maximum and a minimum need not be obtained.
Ok, I am not entirely sure how to show that this is bounded. I know that if I have an interval such as $I = [-N,N]$ where $f$ is cont and closed, then by the boundedness theorem, it is bounded and by max-min theorem then $|f|$ is a max or min on some $r \in I$. But how do I show this when $f: \Bbb R \longrightarrow \Bbb R$?