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?