Let $f:\mathbb R \to \mathbb R$ be a continuous function and smooth on $(-\infty,0)$ and $(0,+\infty)$ respectively.
For any $\epsilon>0, a>0$, can we always find a smooth function $g:\mathbb R \to \mathbb R$ such that $g|_{\mathbb R\backslash (-a,a)}=f$ and the uniform norm $\|g-f\|_{\mathbb R}<\epsilon$? Is there an explicit construction (I am okay with abtract non-constructive proof, though)?
I am aware of https://en.wikipedia.org/wiki/Mollifier, but the convolution there changes $f$ globally not locally.