Let $g$ be a $C^r$function defined in a neighborhood $U$ of $\mathbf{x_0}$ in $\mathbb{R}^n$. Show that if $\phi:\mathbb{R}^n\to \mathbb{R} $ is a $C^r$ function whose support lies in $U$, then the function:$$h(\mathbf{x})=\begin{cases}\phi(\mathbf{x})g(\mathbf{x})&\mbox{for }\mathbf{x}\in U\\0\qquad &\mbox{for }\mathbf{x}\notin \mbox{Support }\phi\end{cases}$$
is well-defined and of class $C^r$ on $\mathbb{R}^n$.
My approach: outside Support $\phi$, $h$ is clearly well-defined (if $\mathbf{x}\in U$ then $h$ seems to give two values, however $\phi$ is zero in a neighborhood of $\mathbf{x}$, hence $h=0$) and of class $C^r$ since it's identically zero (note that $\mathbb{R}^n-$ Support $\phi$ is open, since Support $\phi$ is closed). If $\mathbf{x}\in \operatorname{Int}$ (Support $\phi$), then $h$ equals the product of $\phi$ and $g$; therefore $h$ is of class $C^r$. Now what happens if $\mathbf{x}\in \operatorname{Bd}$ (Support $\phi$)? I'm not sure about my approach, any help would be greatly appreciated.