## Supremum of continuous functions on $\mathbb{R}$ [closed]

If $f(x)$ is a continuous function on all of $\mathbb R$, with the property that $\sup_{x\in\mathbb R}|f(x)|\leq 1$. If this is the case, how I can test if the sup is attained or not? (i.e., if there exists at least $x_{o}\in \mathbb R$ such that $|f(x_{o})|\geq |f(x)|, \forall x\in \mathbb R$).

Should we have something like $\lim_{x\to\pm\infty}|f(x)|=0$, or something else?

-
$\lim\sup_{x\to\pm\infty} |f(x)|<1$ is sufficient but not necessary. – Will Sawin Jun 15 at 17:39
Will is incorrect. It is neither. But MathOverflow is probably not the place for this question. – Gerald Edgar Jun 15 at 18:06
(he probably meant $\limsup |fx| < \sup |f(x)|$) @Catherine: a good place for your question is e.g. en.wikipedia.org/wiki/Wikipedia:Reference_desk/… – Pietro Majer Jun 15 at 18:22