A question about the proof of Level sets of Smooth Functions 
I am stuck at understanding the last line. As far as I understand, the only guaranteed fact is that $B_{r_j}(x_i)$ includes the support of $h((x-x_i)/r_i))$. Even if $x$ is included in $B_{r_j}(x_i)$, it cannot be said that $h(x)$ is nonzero. So I think the proof is wrong. Am I missing something? It really frustrates me...
 A: You are correct, since by declaring $h$ to be a function "supported in $B_1(0)$," we are implicitly allowing functions $h$ whose supports are strictly contained in $B_1(0)$, and so we could have $f(x) = 0$, even though $x\in B_{r_i}(x_i)\subset \Bbb R^n\smallsetminus K$. What we really want is to use functions $h$ whose supports "go right up to the boundary of the ball," i.e. $0 < h < 1$ for $x\in B_{r_i}(x_i)\smallsetminus \overline{B_{r_i/2}}(x_i)$ and $h = 0$ for $x\in \Bbb R^n\smallsetminus B_{r_i}(x_i)$. To correct the proof, we should use a function like $H$ in Lemma 2.22 with $r_1 = 1/2$ and $r_2 = 1$.
To see how the proof as stated fails in a concrete example, take $M = \mathbb R^n$, and $K$ the complement of the open unit ball centered at the origin. We have a canonical way to write $M\smallsetminus K$ as a countable union of balls, namely as itself $M\smallsetminus K = B_1(0)$. If $h$ is a function equal to $1$ in $\overline{B}_{1/2}(0)$ and compactly supported in $B_{3/4}(0)$ (thus having the property that it is "supported in $B_1(0)$"), then clearly the function $f$ we obtain from the proof does not have the desired property, since it is equal to $0$ at points not belonging to $K$. Here we also see how taking $h$ to be a function whose support "goes right up to the boundary" fixes the problem.
