I am looking through a practice exam to prepare for an upcoming final and I am having through with this question.
Question: Let $M$ be a manifold, $p \in M$, and $U \subset M$ an open set containing $p$. Show there is a continuous function $f : M \to [0, 1]$ such that $f(p) = 1$ and $\overline{f^{-1}((0, 1])}$ is a subset of $U$.
The bar is the closure of the set.
My Ideas: Around $p$ there is an open set $V$ which is homeomorphic to the unit ball in $\mathbb{R}^n$ for some $n$. Let $g : V \to B_1(0)$ witness this. I am not sure if there is a way to extend $g$ so that its domain is all of $M$. But even if I did get this I am not sure how to make $f(p) = 1$. If I am not mistaken once I can map to the ball I can project onto $[0, 1]$ to get a continuous map there.
Thanks for any help.
You can use Urysohn's lemma to get such a continuous function.
If you want your function to be smooth as well, then look up mollifiers and/or partitions of unit.