How to link two curves?

Consider a function $\rho_1$ which is smooth with support contained in $\left[a,0\right]$, and $\int_{\mathbb R}\rho_1(x)dx=1$ and put $f_1(x):=\int_x^{+\infty}\rho_1(x)dx$. Then $f_1$ is a smooth function such that $f_1(x)=1$ if $x\leq a$ and $f_1(x)=0$ if $x\geq 0$. We put $F(x):=\begin{cases}f(x)f_1(x)&\mbox{ if }x\leq 0\\ 0&\mbox{ otherwise}\end{cases}$. Then $F$ is a smooth function which is equal to $f$ on $\left(-\infty,a\right]$ and $0$ on $(0,+\infty)$. By the same way, we can find a smooth function $G$ which is equal to $g$ on $\left[b,+\infty\right)$ and $0$ on $\left(-\infty,1\right)$. Now put $h:=F+G$.