I've got a revision question where I have to prove that a function has a extrema when the limit as x approaches $\pm \infty $ is zero and and $f(0)=1$.
I assume I should use Bolzano Intermediate value theorem ($f : \mathbb{R} \to \mathbb{R}$ is continous, but I do not have a closed interval as the theorem states) but there's something missing, so I would appreciate your hints. Thanks.
Since $f$ goes to $0$ at $\pm \infty$, there is some $R > 0$ such that $f(x) < 1$ for $|x| > R$. Now the maximum of $f$ restricted to $[-R, R]$, which must be at least $1 = f(0)$, has to be the global maximum.
Note that you do need $f$ to be non-negative somewhere (this is guaranteed by $f(0) = 1$), otherwise $f(x) = - e^{-x^2}$ is a counterexample.