In "Loring W. Tu, An introduction to manifolds" the following question exists: Let $q$ be a point of an $n$-dimensional manifold $M$ and $U$ any neighborhood of $q$. Construct a smooth bump function at $q$ supported in $U$. I answered that question but I want to make sure. Here is my answer:
Let $q$ be arbitrary of $M$ that is contained in a neighborhood $U\subset M$. Then, there exists a coordinate chart $(V,\phi)$ in the maximal atlas of $M$ such that $q\in V \subset U$. In particular, there exists a smooth bump function $\rho:\mathbb{R}^n \to \mathbb{R}$ at $\phi(q)$ supported in $\phi(V)$ that is identically $1$ in a neighborhood $B_r(\phi(q)) \subset \phi(V)$, say, of $\phi(q)$. Define a map $f:M\to \mathbb{R}$ by $$ f(p) = \begin{cases} \rho\bigl(\phi(p) \bigr), &\text{$p\in V$}, \\ 0, &\text{$p\not\in V$}. \end{cases} $$ Being the composite of two smooth function, $f$ is smooth on $V$ and hence on the whole manifold $M$. If $p\in \phi^{-1}\bigl( B_r(\phi(q)) \bigr)$, then $\phi(p) \in B_r\bigl( \phi(q) \bigr)$ and therefore, by the construction of $\rho$, $\rho\bigl( \phi(p) \bigr)=1$. That is, $f \equiv 1$ on the neighborhood $\phi^{-1}\bigl( B_r(\phi(q)) \bigr)$ of $q$. Clearly, by the definition of $f$, $supp\, f \subset V \subset U$. Hence, $f$ is a smooth bump function at $q$ supported in $U$.
Can anyone please revise my proof ?. I appreciate your help. Thanks in advance.
Note: A smooth bump function $f:M\to \mathbb{R}$ at a point $q\in M$ supported in $U\subset M$ is a non-negative smooth function such that $f\equiv 1$ on a neighborhood $V_q \subset U$ of $q$ and that $supp\, f \subset U$.
Yes, I am sure that the function you gave ($f(x)=\sin x$ on $(0,\pi)$ and $0$ elsewhere) is not continuous. Imagine its graph.
– Hussein Eid Jul 06 '17 at 07:11