Partitions of unity from PMA Rudin 
It's partitions of unity theorem from PMA Rudin. Rudin asserts that exists function $\varphi\in C(\mathbb{R}^n)$ such that $\varphi(x)=1$ on $B(x)$ and $\varphi(x)=0$ outside $W(x)$. But it's not so obvious to me.
Can anyone explain to me in detail why such function exists?
Edit: Rudin's wrote property $(b)$ is clear, i.e. each $\psi_i$ has its support in some $V_{\alpha}$.
$\text{supp}(\psi_{i+1})=\text{cl}\{x: \psi_{i+1}(x)\neq 0\}=\text{cl}\{x: (1-\varphi_1)\dots(1-\varphi_i)\varphi_{i+1}\neq 0\}$.
Since $(1-\varphi_1)\dots(1-\varphi_i)\varphi_{i+1}\neq 0$ $\Leftrightarrow$ $\varphi_1\neq 1, \dots, \varphi_i\neq 1$ and $\varphi_{i+1}\neq 0.$ 
But $\varphi_1\neq 1$ on some $U_1\subset B(x_1)^c, \dots, \varphi_i\neq 1$ on some $U_i\subset B(x_i)^c$ and $\varphi_{i+1}\neq 0$ on some $U_{i+1}\subset \overline{W(x_i)}$.
Hence $$\text{supp}(\psi_{i+1})\subset \overline{W(x_i)}\cap B(x_1)^c \cap \dots \cap B(x_i)^c=\overline{W(x_i)} \cap (B(x_1)\cup \dots \cup B(x_i))^c=$$$$=\overline{W(x_i)}\setminus (B(x_1)\cup \dots \cup B(x_i))\subseteq \overline{W(x_i)} \subset V_{\alpha(x_i)}.$$
Hence $\text{supp}(\psi_{i+1})$ lies in some $V_{\alpha}$.
Is my proof right?
 A: Let $B(x)$ have radius $b$, $W(x)$ have radius $w$, we have $b < w$.
Define $v(t) = \begin{cases}
1, & 0 \le t < b \\
1-{t-b \over w-b}, & b \le t < w \\
0, & \text{otherwise}
\end{cases}$
Let $\phi(y) = v(\|x-y\|)$. Since $v$ and $\|\cdot\|$ are continuous we see
that $\phi$ is continuous.
Aside:
Note that if $\phi_{i+1}(x) = 0$ then $\psi_{i+1}(x) = 0$ hence
$\operatorname{supp} \psi_{i+1} \subset \operatorname{supp} \phi_{i+1}\subset \overline{W(x_{i+1})} \subset V_{\alpha(x_{i+1})}$.
A: The function $$\varphi(x) := \begin{cases} e^{-1/(1-x^2)} : & |x| < 1; \\ 0: & |x| \ge 1; \end{cases}$$ is $C^{\infty}$, positive and zero outside of $[-1,1].$ 
Its integral $\psi(x) = \int_0^x \varphi(t) \, \mathrm{d}t$ is constant zero left of $-1$ and a positive constant right of $1$.
By adding rescaling and shifting $\psi(x)$ and $\psi(-x)$ to the left or right, you can find a $C^{\infty}$ function $f$ that is constant $1$ on $[-\varepsilon/2,\varepsilon/2]$ and constant $0$ outside of $(-\varepsilon,\varepsilon),$ for any $\varepsilon > 0.$ In several variables, you can take the product $u(x_1)...u(x_n)$ for the same effect.
A: Suppose that $U,V$ are open in $X$ a metric space and $\overline U\subseteq V$. Then you can define $f(x) = d(x,V^c) /( d(x,V^c)+d(x,U))$ and note first, that $f$ is continuous, since $d(x,V^c)+d(x,U)>0$ always: if it is zero then $x\in \overline U$ and $x\notin V$, which is impossible. Second, $f(x)=1$ if $x\in U$, and if $x\notin V$ then $f(x)=0$. In fact $f$ is nonzero if and only if $x\in V$, and it is one precisely if $x\in \overline U$. This has the disadvantage of being potentially nonsmooth, but you can always smooth it out by taking a convolution with an appropriate function. 
