I want to solve the following problem:
Let $C,E\subset\mathbb{R^n}$ such that $C$ is compact,$E$ is closed and $ C\cap E = \emptyset$. Show that there exist a function $f\in C^\infty(\mathbb{R^n})$ such that $f = 1$ in $C$ and $f = 0$ in $E$.
My attempt:
I want to invoke the following lemma:
Let $U \subset \mathbb{R^n}$ be open and $C \subset \mathbb{R^n}$ compact such that $C \subset U$. Then there exist $\phi \in C^\infty$ such that $\phi=1$ in $C$ and supp$\phi \subset U$
Then we take $U=E^{c}$ and we are done, because this means that $f=1$ in $C$ and supp$f \subset U$ and this implies that $f = 0$ in $E$.
Am I right? thanks in advance :).