I have a function $f\in C^\infty: \mathbb{R}^n \to \mathbb{R}$ with the properties :
1) $f(x) = 0$, when $\Vert{x}\Vert \le 1$,
2) $0 < f(x) < 1$, when $1 < \Vert{x}\Vert < 2$,
3) $f(x) = 1$, when $\Vert{x}\Vert \ge 2$.
I want to generalize my $f$ to $g\in C^\infty: \mathbb{R}^n \to \mathbb{R}$, so that for some closed subset $C$ and some open subset $U$ ($C \subset U$), one has
1) $g(x) = 0$, when $x \in C$,
2) $0 < g(x) < 1$ when $x \in U / C$,
3) $g(x) = 1$ when $x \not\in U$.
What is the simplest way to do this?