I need help in a passage of a proof.
Let $M$ be a smooth manifold, let $U$ be an open subset of $M$, and $K$ a compact subset of $M$ such that $K\subseteq U$.
Let $H\colon R^n\to R$ be a $C^\infty$ function such that $H(x)=1$ for all $x$ in $\overline{B^n_1(0)}$, $H(x)=0$ for all $x\notin B^n_2(0)$ and $0<H(x)<1$ in all the other cases.
Let $q$ be a point of $K$, and $(U_q,\phi_q)$ a smooth chart such that $\phi_q(q)=0$, $Uq\subseteq U$, and $B^n_3(0)\subseteq \phi_q(U_q)$.
Finally, let $f_q:M\to R$ with $f_q(p)=H(\phi_q(p))$ when $p\in U_q$, $f_q(p)=0$ if $p\notin U_q$.
Why $f_q$ is $C^\infty$ in $M$?
I know that $f_q$ is $C^\infty$ in $U_q$, since composition of $C^\infty$.
My book says that $f_q$ is also $C^\infty$ in the open subset $M\setminus \phi_q^{-1}(\overline{B^n_2(0)})$, because it is identically $0$.
But (my objection is that) $\phi_q^{-1}(\overline{B^n_2(0)})$ is closed in $U_q$, not in $M$.
My book also says that supp$f_q \subseteq Uq$, but i can't see it. I see (if I'm correct) that $\{ p\in M:f_q(p)\neq 0\}=\phi_q^{-1}(B^n_2(0))\subseteq U_q$, but when i take the closure in $M$ i don't know how to say, form this, that supp$f_q\subseteq U_q$.
Thank you for your help.
Because $\phi_q$ is a coordinate chart, its inverse is continuous. Since $\overline{B^n_2(0)}$ is compact, it follows that $\phi_q^{-1}\big(\overline{B^n_2(0)}\big)$ is also compact, and therefore closed in both $U_q$ and $M$.
EDIT: To answer your second question, note that $\phi_q^{-1}\big(\overline{B^n_2(0)}\big)$ is a closed subset of $M$ containing $\phi_q^{-1}\big({B^n_2(0)}\big)$, so it also contains the closure of this set, which is the support of $f_q$. Since $\phi_q^{-1}\big(\overline{B^n_2(0)}\big)\subseteq U$, it follows that $\operatorname{supp} f_q\subseteq U_q$.