4

Assume $f$ is a function over real numbers such that $f(x)>0$ for all $x$. Suppose that $\displaystyle \lim_{x \to \infty} f(x) =\lim_{x \to -\infty} f(x) = 0.$ Prove $f$ attains its maximum.

Firstly, I believe the question should say continuous function. Then it is easy to see that since we can consider some compact set $[N_1,N_2]$ for the function, the function must have a maximum on this interval, call it $M$. Then the maximum of the function is $\max\{M,0\}$ which exists.

Puzzled417
  • 6,956

4 Answers4

2

Firstly, the claim is not correct for a general function $f: \mathbb{R} \to (0 , + \infty)$ where $\lim_{x \to \pm \infty} f(x) = 0$. For a counterexample, consider $f(x) = \begin{cases} 1/ |x| & x \neq 0 \\ 1 & x = 0\end{cases}$, which has no maximum despite satisfying the hypothesis. We must consider continuous functions. For the duration of this answer, we suppose $f$ is continuous, as well as satisfying the hypotheses you stated.-

Let $a = \max \{ f(x) : - 1 \leq x \leq 1 \} > 0 $, which exists by the extreme value theorem. If $\lim_{x \to \pm \infty} f(x) = 0$, then there exists $N \geq 0$ such that if $|x| > N$, then $0 \leq f(x) \leq a / 2$. Now, set $M = \max \{ f(x) : - N \leq x \leq N \}$, which also exists by the extreme value theorem. Since we suppose $N \geq 1$, it follows that $M \geq a$. Now, we note that $$\sup \{ f(x) : x \in \mathbb{R} \} = \max ( \sup \{ f(x) : - N \leq x \leq N \} , \sup \{ f(x) : |x| > N \}) = \max(M, \sup \{ f(x) : |x| > N \}) = M,$$ as $M \geq a \geq a / 2 \geq f(x)$ whenever $|x| > N$. But there exists $x \in [- N, N]$ such that $f(x) = M$, so $M = \sup \{ f(x) : x \in \mathbb{R} \}$ is in fact a maximum.

AJY
  • 8,729
  • I am confused why you are working with supremums here. – Puzzled417 Feb 23 '16 at 00:59
  • It'd be presumptuous to say the maximum of $f$ over its domain before confirming such a thing exists. But we call $s$ the maximum of $S$ if $s$ is the supremum of $S$, and $s \in S$. – AJY Feb 23 '16 at 01:00
  • Also was there any reason you choose $-1$ and $1$ for your bounds? And what does the fact that $f(x) > 0$ for all $x$ have to do with it? Is that even necessary? – Puzzled417 Feb 23 '16 at 01:07
  • There's nothing special about the numbers $\pm 1$. I could just as easily have chosen $[- \sqrt{e^{\pi/5}}, \sqrt{e^{\pi/5}}]$ and let $N \geq \sqrt{e^{\pi/5}}$. As for the second question, I'll edit in a more general argument. – AJY Feb 23 '16 at 01:10
  • Was it even necessary? – Puzzled417 Feb 23 '16 at 01:17
  • Actually, in general the argument doesn't work without something like "positivity". Take for example $f(x) = \begin{cases} 2 - |x| & - 1 \leq x \leq 1 \ 1 / |x| & |x| > 1 \end{cases}$, which has no maximum. – AJY Feb 23 '16 at 01:19
  • Wait so is the question still correct? – Puzzled417 Feb 23 '16 at 01:21
  • How do you mean "Was it even necessary?" I chose an initial compact interval ($[- 1, 1]$, though I could well have chosen many other intervals with some adjustments) on which I knew that I could get a maximum, and thereafter chose a larger interval such that I knew (by the limit conditions) nothing off of the larger interval would surpass the pre-determined maximum. – AJY Feb 23 '16 at 01:22
  • The question as stated is correct. But dropping the "positiveness" hypothesis opens us to certain counterexamples, unless we add other hypotheses in its place, e.g. there exists $C$ such that $f(x) > C$ for all $x \in \mathbb{R}$, and $\lim_{x \to \pm \infty} f(x) = C$. – AJY Feb 23 '16 at 01:25
0

Yes, you're exactly right. As long as you're careful about what you're doing, that is how you do the proof. It's clearly false for non-continuous functions, for a counter example, consider $f(x)=|1/x|$ and $f(0)=0$

0

You are correct that the function MUST be continuous. As a simple counterexample, consider the function \begin{equation} f(x)=\begin{cases} \dfrac{1}{(x-2)} & \text{if $x\geq4$}. \\ \dfrac{-1}{(x-5)} & \text{$x<4$}. \end{cases} \end{equation} Then this function never actually attains its maximum. So yes, you need $f(x)$ to be continuous. You also need a closed and bounded interval, $[a,b]$. To see a proof, look at the extreme value theorem, https://en.wikipedia.org/wiki/Extreme_value_theorem.

JMP
  • 21,771
Julio
  • 136
  • You do not need a closed bounded interval: since $\lim_\infty \lvert f\rvert = 0$, the maximum of $f$ is indeed attained. (But you do need continuity.) – Clement C. Feb 23 '16 at 00:35
  • @ClementC., does a function actually need to be continuous in order to attain a maximum? ;-) – Barry Cipra Feb 23 '16 at 00:39
  • No, but the assumption of continuity is needed for the statement to hold for all $f$ satisfying the assumptions. Quantifiers, thou be damned! :) @BarryCipra – Clement C. Feb 23 '16 at 00:43
  • @ClementC., it's clear (given the plethora of counterexamples) that some additional assumption is needed, and continuity is probably the most natural. But it's not the only assumption one could possibly add. – Barry Cipra Feb 23 '16 at 00:48
  • Indeed... ${}{}{}{}$ – Clement C. Feb 23 '16 at 00:50
  • For example, upper-semicontinuity ought to suffice (as a substitute for continuity). – John Dawkins Feb 23 '16 at 01:41
0

Yes, you do need continuity. Then, assuming $f$ is continuous, positive, and $\lim_{\pm\infty} f=0$ here is an outline:

  • Since $f(x)>0$ for all $x$, then in particular $f(0) > 0$.

  • Take $\varepsilon = \frac{f(0)}{2} > 0$. Using that the limits at $\pm\infty$ are $0$, use that with this $\varepsilon$ to argue that there exists $A>0$ such that $0 < f(x) \leq \varepsilon$ outside $[-A,A]$.

  • Apply the fact that every continuous function attains its maximum on a bounded closed interval to the interval $[-A,A]$. There is a maximum for $f$ on $[-A,A]$, call it $M$, attained at some point $x_0 \in[-A,A]$.

  • Clearly, the maximum $M$ of $f$ on $[-A,A]$ satisfies $M \geq f(0) > \varepsilon$, so this is also a maximum on $\mathbb{R}$.

Clement C.
  • 67,323