Suppose that $f:\Bbb R\to \Bbb R$ is continuous and that $f(x)\to 0$ as $x\to \pm\infty$. Prove that $f$ is uniformly continuous.
Since $f(x)\to 0$ as $x\to \pm\infty$ we have $|f(x)|<\epsilon $ whenever $x<-K$ and $x>K$ where $K>0$.
Also $f$ is uniformly continuous on $[-K,K]$ as the domain is compact.
Hence $f$ is uniformly continuous in $(-\infty,-K)\cup [-K,K]\cup (K,\infty)$.
But how to conclude that $f$ is uniformly continuous on $\Bbb R$ from above as I may chose $x\in (-\infty,-K);y\in [-K,K]$ ,how to conclude that $|f(x)-f(y)|<\epsilon $ from above for a given $\epsilon$?
Please suggest the edits required.
Well observed that you have to take care at the "glue" points! But note that $f$ is also uniformly continuous on $[-K-1,K+1]$ and that you may enforce $\delta<1$.