Prove that a uniformly continuous function $f(x): \mathbb{R}_+ \rightarrow \mathbb{R}$ attains a maximum

I have that $f(x) : \mathbb{R}_+ \rightarrow \mathbb{R}$ is a uniformly continuous function s.t. $f(0) = \alpha \in \mathbb{R}_+$ and $lim_{x \rightarrow \infty} f(x)=0.$

I believe that if I can show that $\mathbb{R}_n$ is bounded, then I can use the extreme value theorem to show that the maximum must exist and be in $\mathbb{R}_+$. My idea is that I can define my distance function $d(x,y) = |x-y|$ and create a complete metric space. Thus my uniformly continuous function maps from a complete metric space to $\mathbb{R}$, making my function bounded. Since my function is uniformly continuous and bounded on a closed set $\mathbb{R}_+$, there exists $c$ and $d$ in $[0, \infty)$ such that:

$f(c) \leq f(x) \leq f(d) \forall x \in [0, \infty)$ with $d$ being my maximum.

• So you use the convention $0\in\mathbb{R}_+$? – Jeppe Stig Nielsen Sep 16 '18 at 22:40
• @JeppeStigNielsen sorry, I'm not understanding your question – Corran Horn Sep 16 '18 at 22:46
• Is $\mathbb{R}_+ = \left[ 0,\infty \right)$, or is $\mathbb{R}_+ = \left( 0,\infty \right)$? I think it is true that if $f:\left[ 0,\infty \right) \to\mathbb{R}$ is continuous (uniformly continuous is not needed) and attains just one strictly positive value, and satisfies $\lim_{x\to+\infty}f(x)=0$, then $f$ attains its maximum. It will eventually be smaller than half that positive value, so you can look at a closed and bounded interval. – Jeppe Stig Nielsen Sep 16 '18 at 22:50
• Since $f$ is apparently defined at $0$, I think you want $[0,\infty)$ as your domain. The fact that $f$ vanishes at infinity seems useful since for this positive number $\alpha$ we may find $A>0$ so that $|f(x)|<\alpha$ whenever $x>A$. – Matt A Pelto Sep 16 '18 at 22:50
• @CorranHorn There are people who use the notation $\mathbb{R}_+$ for the poisitive reals. Anyway, the title is false when $f(0)<0$ as witnessed by $f(x)=-\exp(-x)$. – user10354138 Sep 16 '18 at 22:51

Split into three cases.

Case 1. $\alpha>0$. As $\lim_{x\rightarrow \infty} f(x) =0, \exists A >0$ s.t. $\forall x > A, |f(x)| < \alpha$.

Thus, we have a closed and bounded interval $[0,A]$, and so by the extreme value theorem we know that there must exist $c,d \in [0,A]$ s.t. $f(c) \leq f(x) \leq f(d) \,\forall x \in [0,A]$.

Thus, $d$ is the maximum of $f(x)$ on $[0,\infty)$.

Case 2. $\alpha =0$. Let $\exists x' \in \mathbb{R}_+$ s.t. $f(x')>\alpha$. As $\lim_{x\rightarrow \infty} f(x) =0, \exists B >0$ s.t. $\forall x > B, |f(x)| < f(x')$.

Thus, we have a closed and bounded interval $[0,B]$, and and we can apply the extreme value theorem.

Case 3. $\alpha =0$. Let $x'$ s.t. $f(x')> \alpha$ not exist $\in \mathbb{R}_n$. Then $\alpha \geq x \forall x \in \mathbb{R}_+$ and thus is our maximum.

Is this correct?

• basically but please notice that $\mathbb{R}_+:=\{x \in \mathbb{R} : x>0\}$ and $[0,\infty):=\{x \in \mathbb{R} : x \geq 0\}$. These sets are not equal since $0$ is in the latter but it is not in the former. – Matt A Pelto Sep 16 '18 at 23:58
• @MattAPelto I believe that $\mathbb{R}_+$ is $[0, \infty)$ while $\mathbb{R}_{++}$ is $(0, \infty)$? – Corran Horn Sep 17 '18 at 0:00
• but you write $f(0) \in \mathbb{R}_+$. Hopefully you notice how we used the fact that $f(0)>0$ in finding this number $A>0$. If $f(0)\leq 0$ then the argument does not follow as written. – Matt A Pelto Sep 17 '18 at 0:08
• If $\alpha=f(0)=0$, @MattAPelto is right you need another proof. Maybe treat two cases, (1) when $0$ is actually the supremum of $f$, and (2) when $f$ attains strictly positive values somewhere. – Jeppe Stig Nielsen Sep 17 '18 at 7:15
• @MattAPelto I added to my answer to take into account your comment. Thank you for the help! – Corran Horn Sep 18 '18 at 3:02