If $f \in {C^\infty }(( - \infty ,1))$ and $g \in {C^\infty }(( 0 ,+\infty))$, then for arbitary real numbers $a<0$ and $b>1$, can we find a $C^\infty(R)$ function $h$ which satisfies that $h$ is equal to $f$ when restricted to $( - \infty ,a]$, and $g$ when restricted to $[ b, \infty)$?
Complement: Someone has given a beautiful construction. I have an addtional question, that is can the new function $f$ satisfy the addtional conditions that ${f^{(n)}}(a) = {h^{(n)}}(a)$ and ${g^{(n)}}(b) = {h^{(n)}}(b)$ for all $n=0,1,2...$ It is obvious that such $h$ cannot exist for arbitrary $f$ and $g$(e.g.$f$ is analytical), then what conditions do we have to put on $f$ and $g$? Or for arbitrary $f$ and $g$, if we can find a $h$ such that ${f^{(n)}}(a) = {h^{(n)}}(a)$ and ${g^{(n)}}(b) = {h^{(n)}}(b)$ for all $n=0,1,2...k$, with a definite $k$?