Given \(r_2>r_1>0\). There is a smooth function \(H:\mathbb{R}^n \to \mathbb{R}\) such that \(H\equiv 1\) on \(\overline{B_{r_1}(0)}\), \(H(x)\in (0,1)\) for \(x\in B_{r_2}(0)\setminus \overline{B_{r_1}(0)}\) and \(H\equiv 0\) on \(\mathbb{R}^n\setminus B_{r_2}(0)\).

Such a function is called a smooth bump function.

Proof
Let \(h_{r_1,r_2}\) be the smooth transition function defined here . Then \(H(x)=h_{r_1,r_2}(|x|)\) suffices the stated properties.