# Math Help - max and min of continuous function

1. ## max and min of continuous function

I could use some help getting this proof going.

Let $f:R\rightarrow [0,\infty)$ be continuous. Suppose $lim_{x\rightarrow +\infty} f(x)=0$ and $lim_{x\rightarrow -\infty} f(x)=0$.

Prove that $f$ does not have a minimum on $R$ and
prove that $f$ has a maximum on $R$.

2. To show a maximum exists: first, if f is the zero function, then every point is a maximum. Otherwise, there is some x such that f(x)>0. Now by hypothesis you can find M>0 such that f(y)<f(x) for all y<-M and all y>M. Finally, you know that a continuous function achieves its min/max values on a compact set, so that f restricted to [-M,M] has a maximum, and by construction, [-M,M] contains at least one point where the value of f is greater than at any point outside [-M,M], so in fact it's a global maximum.

For the minimum...it's actually not true as stated, since the zero function is a counterexample. Ruling that out (for instance, by changing the codomain to (0,inf)), suppose there is a minimum (it would be some nonzero value) and derive a contradiction.