Suppose we have a compact set $A$ and a bounded open set $O$ such that $A\subset O$. How would I go about showing the existence of a continuous function $f: \mathbb{R}\to\mathbb{R}$, such that the function $f$ has the properties: that $f=1$ on the compact interval, and $f$ vanishes on $O^c$, and $f(x)\in[0,1]$?
Not really sure where to begin.
A few things I know (not sure if they're useful here but here I go anyway...)
I notice that $O\subset A\subset \mathbb{R}$, so by the Heine-Borel Thm, it must be the case that $A$ is both closed and bounded.
$f$ needs to be shown to be continuous so it has to obey that $\forall\epsilon>0\exists\delta>0: |x-c|<\delta\implies |f(x)-L|<\epsilon$
(or that ) $f^{-1}(O)$ is open for all open sets $O$.
Now, for the one theorem that I think will be of help: Borel s Thm.
Let $f:[a,b]\to \overline{\mathbb{R}}$ be (Lebesgue )measurable and finite almost everywhere. [is there any gurantee here that our $f$ is measurable in order to employ this theorem?]
Then $\forall\epsilon>0\exists g:\text{ g is continuous on [a,b]}$ such that $|f-g|<\epsilon$ (except possibly on a set of measure less than $\epsilon$. Furthermore, if $f(x)\in[k,K]$ for $k,K\in\mathbb{R}$, it can be arranged for $g(x)\in[k,K]$ as well.
Any help to start would be appreciated. Thanks.