# Sufficient condition for absolute maximum

I am trying to prove or disprove the following statement.

Let $f : [0, +\infty) \rightarrow \mathbb{R}$ be a continuous nonnegative function such that $f(0) = 0$ and $\displaystyle \lim_{x \to +\infty} f(x) = 0$. Then $f$ attains an absolute maximum.

I can show that such a function is bounded, but I don't know whether the above statement is true or false. I have tried to prove it using some ideas from the proof of Weierstrass extreme value theorem, but I was not successful. Could anyone give a hint for the proof or a counterexample?

EDIT. Using Jack D'Aurizio's comment below, I think I can prove the statement. If $f \equiv 0$, then the statement is trivial. Otherwise, there exists $x_1 \in [0, +\infty)$ such that $f(x_1) > 0$. Since $\displaystyle \lim_{x \to +\infty} f(x) = 0$, there exists $x_0 \geqslant x_1$ such that \begin{equation*} |f(x)| \leqslant f(x_1) \quad \forall \, x \geqslant x_0. \end{equation*} By Weierstrass's theorem, there exists $\overline{x} \in [0, x_0]$ such that $f(x) \leqslant f(\overline{x}) \enspace \forall \, x \in [0, x_0]$. Besides, $f(x_1) \leqslant f(\overline{x})$, because $x_1 \in [0, x_0]$. Then, we have \begin{equation*} f(x) \leqslant f(x_1) \leqslant f(\overline{x}) \quad \forall \, x \geqslant x_0. \end{equation*} $f(\overline{x})$ is the maximum value of $f$ on $[0, +\infty)$.

Is this proof correct? If it is, can it be improved?

• Try to exploit that any continuous function attains a maximum over a closed interval. What do you get by assuming that $f$ does not attain an absolute maximum? – Jack D'Aurizio Jun 21 '17 at 16:54
• Consider that $\lim_{x\to +\infty}f(x)=0$ implies that for any $\varepsilon>0$ there is some $x_0$ ensuring $\left| f(x)\right|\leq \varepsilon$ for any $x\geq x_0$. For short: the tail does not matter. We may focus on the $[0,x_0]$ interval only. – Jack D'Aurizio Jun 21 '17 at 16:55
• @JackD'Aurizio I edited the question following your suggestion. Thanks. – Paolo Jun 21 '17 at 18:07