A function vanishing at infinity is uniformly continuous If $f\in C_0(\mathbb{R})$ (i.e. $f$ continuous and for all $\varepsilon>0$ there is $R>0$ such that $|f(x)|<\varepsilon$ whenever $|x|>R$), then why is $f$ uniformly continuous? I know that we should somehow use that $f$ is "small" outside a compact interval (on which it is uniformly continuous), how can we nicely write down the $\delta$?

We shall use the fact that a continuous function in a closed interval is uniformly continuous.
Let $f\in C_0(\mathbb R)$ and $\varepsilon>0$. We shall find a $\delta>0$, such that $\lvert x-y\rvert<\delta$ implies that $\lvert f(x)-f(y)\rvert<\varepsilon$.
As $\lim_{\lvert x\rvert\to\infty}f(x)=0$, there exists an $M>0$, such that $\lvert x\rvert>M$, implies that $\lvert f(x)\rvert<\varepsilon/3$.
Since $f$ is uniformly continuous in $[-M,M]$, there exists a $\delta>0$, such that
$x,y\in [-M,M]$ and $\lvert x-y\rvert<\delta$ implies that $\lvert f(x)-f(y)\rvert<\varepsilon/3$.
Now let $x,y\in\mathbb R$, with $\lvert x-y\rvert<\delta$.
Case I. $x,y\in [-M,M]$. Then indeed
$$\lvert f(x)-f(y)\rvert<\varepsilon/3<\varepsilon.$$
Case II. $|x|,|y|>M$. Then $\lvert f(x)\rvert<\varepsilon/3$ and
$\lvert f(y)\rvert<\varepsilon/3$ and hence $\lvert f(x)-f(y)\rvert<2\varepsilon/3<\varepsilon.$
Case III. $x\in [-M,M]$ and $\lvert y\rvert>M$. Assume that $y>M$. (The case where $y<-M$ is treated similarly.)
In this case
$$x\le M<y,$$ and hence $$|x-M|<|x-y|<\delta.$$
Also
$\lvert f(y)\rvert<\varepsilon/3$ and thus
$$
\lvert\, f(x)-f(y)\rvert\le \lvert\, f(x)-f(M)\rvert +\lvert\, f(M)-f(y)\rvert \\ \le \lvert\, f(x)-f(M)\rvert +\lvert\, f(M)|+|\,f(y)\rvert <\frac\varepsilon 3+
\frac\varepsilon 3+\frac\varepsilon 3=\varepsilon.
$$
