Prove that $f$ has an absolute maximum on $\mathbb{R}$ Let $f:\mathbb{R}\to\mathbb{R}$ be continuous. Suppose also that $\displaystyle\lim_{x\to\infty}f(x)=\lim_{x\to-\infty}f(x)=0$ while $f(0)=1$. Prove that $f$ has an absolute maximum on $\mathbb{R}$.
 A: What have you tried? Since $f\to 1$ when $x\to 0$ and $f\to 0$ when $x\to\pm\infty$, cannot you find $M,N$ big enough so that $$f<\frac 1 2$$ over the rays $$(-\infty,M),(N,\infty)\text{ ? }$$ Since $f\sim 1$ in a nbhd of $0$, can't you then look at a closed and bounded interval $[N,M]$ and see what's going on?
Roughly speaking, since $f$ is continuous, it will stay close to zero over the rays $(-\infty,M)$,$(N,\infty)$ and will stay close to $1$ in some interval $(-\delta,\delta)$ centered a the origin. This means we can discard "most" of the real line (the neighborhoods of infinity) since $f$ will definitely not have the maximum there, and look at some closed and bounded interval for the maximum.
Some examples you might want to look at are $$f=\frac{\sin x}{x}$$ and $$f=\frac{1}{1+x^2}$$
A: Consider the function $g\colon(-\pi/2,\pi/2)\to\mathbb{R}$ defined by
$$g(t) = f(\tan t)$$
The image of $g$ is the same as the image of $f$ and $g$ can be extended to a continuous function $\tilde{g}\colon[-\pi/2,\pi/2]\to\mathbb{R}$ by defining
$\tilde{g}(-\pi/2)=0=\tilde{g}(pi/2)$. This is a continuous function on a closed and bounded interval, so it has an absolute maximum which can't be $0$ because $\tilde{g}(0)=g(0)=1$. Thus the maximum is positive and is not attained at the extremes of the interval; if this maximum is attained at $t_0$, $f$ attains an absolute maximum at $x_0=\tan t_0$.
A: From $\displaystyle\lim_{x\to\infty}f(x)=\lim_{x\to-\infty}f(x)=0$ deduce that $f(x)<\frac12$ for all  $x\not\in[-M,M]$ for some $M>0$. What is the maximum of $f$ in $[-M,M]$? Is it an absolute maximum? Use that $f(0)=1$.
