$f: ℝ\to ℝ$ is continuous with $\lim_{x\to \infty} f(x)=\lim_{x\to-\infty} f(x)=0, $then $∃z∈ℝ$ so that for every $x∈ℝ : |f(x)| ≤ |f(z)|$ I want to proof the following assertion: Let $f:\mathbb{R} \rightarrow \mathbb{R}$ be a continuous function and $\lim\limits_{x\to\infty} f(x)=\lim\limits_{x\to -\infty} f(x)=0$, then an $z\in \mathbb{R}$ exists, so that $|f(x)|\leq |f(z)|$ for every $x\in \mathbb{R}$.
My notes/thoughts:
Let $(x_n)_{n\in\mathbb{N}}$ be any sequence of real numbers that converges against $\infty$.
$f$ is a continuous function, so that:
$\lim\limits_{n\to\infty} f(x_n)=f(\lim\limits_{n\to\infty}x_n)=0=f(\lim\limits_{n\to\infty}(-x_n))=\lim\limits_{n\to\infty} f(-x_n)$
So the sequences $f(x_n)_{n\in\mathbb{N}}$ and $f(-x_n)_{n\in\mathbb{N}}$ are convergent, therefore one can find $N_1,N_2\in\mathbb{N}$ for any $\epsilon >0$, so that for every $n\geq \max\{N_1,N_2\}=N$: $|f(x_n)|<\epsilon$ and $|f(-x_n)|<\epsilon$
I know the following theorem for continuous functions: "Extreme value theorem" and "Intermediate value theorem", but I don't see, how those could be useful in this case. On my current level, I can only assume that those theorems hold true for a closed AND bounded interval like $[a,b]$.
$\mathbb{R}$ is only a closed set of numbers, but not bounded.
Can someone help me to find the right arguments?
PS:
I apologize for spelling and grammatical errors, I have tried to avoid them.
 A: There are two possible cases:
$1)\;\;f(x)=0\quad\forall x\in\mathbb R\;;$
$2)\;\;\exists\,x^*\!\in\mathbb R\;$ such that $\;f(x^*)\ne0\;.$
In the first case, there exists $\;z=1\in\mathbb R\;$ such that $\;\left|f(x)\right|=0\leqslant0=\left|f(z)\right|\quad\;$ for all $\;x\in\mathbb R\;.$
In the second case, since $\;\lim_\limits{x\to-\infty}f(x)=\lim_\limits{x\to+\infty}f(x)=0\;,\;$ then there exists $\;M>0\;$ such that
$\left|f(x)\right|<\left|f(x ^*)\right|\;\;$ for all $\,x\!\in\,]\!-\!\infty,-M[\,\cup\,]M,+\infty[\;.$
Hence , $\;x^*\in[-M,M]\;,\;$ otherwise we would get the contradiction $\;|f(x^*)|<|f(x^*)|\;.$
By applying Weierstrass extreme value theorem to the continuous function $\;|f(x)|\;$ on the interval $\;[-M,M]\;,\;$ it follows that there exists $\;z\in[-M,M]\;$ such that
$\left|f(x)\right|\leqslant\left|f(z)\right|\;$ for all $\;x\in[-M,M]\;.$
Since $\;x^*\in[-M,M]\;,\;$ it also follows that
$|f(x)|\!<\!|f(x^*)|\!\leqslant\!|f(z)|\;$ for all $x\!\in]\!-\!\infty,\!-M[\cup]M,\!+\infty[.$
Therefore, it results that
$|f(x)|\leqslant|f(z)|\;\;$ for all $\;x\in\mathbb R\;.$
A: Assume that there is an $x_0 \in \mathbb{R}$ such that $f(x_0) \neq 0$ (otherwise the assertion is trivial). Since $\lim\limits_{x \to \pm \infty} f(x) = 0$, there is an $M \geq 0$ such that $|f(x)| < |f(x_0)|$ for all $x \in \mathbb{R} \setminus [-M,M]$. Clearly, $x_0 \in [-M,M]$. On the other hand, by continuity you know that $|f|$ attains a maximum on $[-M,M]$, say at $z$. It follows $|f(x)| \leq |f(z)|$ for $x \in [-M,M]$ as well as $|f(x)| < |f(x_0)| \leq |f(z)|$ for $x \in \mathbb{R} \setminus [-M,M]$.
