Possible Duplicate:
Real Analysis Boundedness of continuous function
I have a real analysis question that I am having trouble with:
Suppose that $f:\Bbb R\to\Bbb R$ is continuous on $\Bbb R$ and $\lim\limits_{x\to-\infty}f(x) = 0$ and $\lim\limits_{x\to\infty}f(x) = 0$. Prove that $f$ is bounded on $\Bbb R$ and attains either a max or a min on $\Bbb R$.
Should I do this by contradiction, perhaps using the fact that if $f(x)$ is unbounded on $\Bbb R$, then WLOG, suppose that it contains a max. Then there exists $s:=\max f(x)$ where $s>f(x)$ for all $x$ in $\Bbb R$. Then $s>f(x_m)>M$ meaning $f(x_m)$ is bounded on $\Bbb R$.
I just don't think this will work since I also have to prove it has a max or min. I can't just assume it has one.