# Real Analysis Boundedness of continuous function

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$?

-
Start by looking at the definition of "bounded." – Emily Oct 22 '12 at 18:30

By assumption there exists an $L>0$ such that $|f(x)|\le 1$ if $|x|\ge L$. Also $f$ is bounded on $[-L,L]$, say by $M\ge 0$. Then $$|f(x)|\le \max(1,M)$$ for all $x\in\mathbb{R}$. The minimum need not be attained as you can see by looking e.g. at $$f(x)=\frac{1}{1+x^2}.$$ The maximum of course also doesn't need to be obtained (look at $-f$ for example).
For a more conceptual argument, let $X$ be a non-compact locally compact Hausdorff space. Then $X^* := X \cup \{\infty\}$, the Alexandroff compactification of $X$, has the property that every $f \in C_0(X)$ extends uniquely to a continuous function $\tilde f$ on $X^*$ with $\tilde f(\infty) = 0$.
Since $X^*$ is compact, $\tilde f$ attains its minimum and maximum on $X^*$. If it attains both min and max at $\infty$, then $\tilde f$ is obviously just the $0$ function, and if it attains at most one extremum at $\infty$, then it must at least attain the other somewhere in $X$, so $f$ attains an extremum in $X$.