# Will $f$ have a maximum value in $[0,\infty)$.

True/False:

Let $f:[0,\infty)\to \Bbb R$ be a continuous function with $\displaystyle{\lim _{x\to \infty}} f(x)=0$. Then $f$ has a maximum value in $[0,\infty)$.

Since $\displaystyle{\lim _{x\to \infty} }f(x)=0\implies$given $\epsilon>0,\exists G$ such that $x>G\implies |f(x)|<\epsilon$.

Now $f$ is uniformly continuous on $[0,G]$ and attains its bounds therein.

Thus $|f(x)|\le M$ on $[0,G]$.

Choose $\epsilon <M$ then we can find $x_0$ such that $f(x_0)>f(x) \forall x$

Hence the result is true.

But the answer is given as false.Where am I wrong?

• $f$ can be negative. Consider $f(x)=-\dfrac{1}{x+1}.$ – mfl Aug 23 '17 at 7:02

The result is false here:

Choose $\epsilon <M$ then we can find $x_0$ such that $f(x_0)>f(x) \forall x$

The statement is false, for example for the function

$$f(x)=-e^{-x}$$ which is a constantly increasing function.

The mistake you made was thinking that just because something is true for $|f|$, that it makes it true for $f$ as well.

It is true, yes, that $|f|$ attains its maximum on $[0,G]$, and that maximum is non-negative (if it's $0$, it's the zero function, so wlog it's positive).

And because that maximum is positive and greater than $\epsilon$, you have for $x>G: |f(x)|<\epsilon < M$, and for $x\in[0,G]: |f(x)|<M$.

It is also true that $|f(x_0)|=M$ for some $x_0$.

It is also true that $|f(x)|<|f(x_0)|$ for all $x$.

It is also true that $f(x)<M$ for all $x$

However, even from all that, you cannot conclude that $f(x)<f(x_0)$ for all $x$, because if $f(x_0)<0$, then $M=|f(x_0)|=-f(x_0)$.

• Yes,I got it.Thank you very much – Learnmore Aug 23 '17 at 10:18