This is an exercise from a real analysis book. It has many parts. Assume a) and b) are true:
a) Suppose $F$ is closed and $O$ is open subset of $\mathcal{R}$ and $F \subset O$, then there is a continuous function $f$ such that $f(\mathcal{R}) \subset [0\, ,1]$, $f(F) = \{1\}$, and $f(O^c) = \{0\}$
b) Let $E \in \mathcal{M}$, then there is a sequence of open sets $\{O_n\}_{n=1}^{\infty}$ and closed sets $\{F_n\}_{n=1}^{\infty}$ such that $F_n \subset E \subset O_n$, $F_n \subset F_{n+1}$, $O_n \supset O_{n+1}$ for all $n$ and $\lambda((\cap_{n=1}^\infty O_n) \setminus (\cup_{n=1}^{\infty} F_n)) = 0 $
c) Let $E \in \mathcal{M}$. Then there is a Lebesgue measurable set $B$ with $\lambda(B) = 0$ and a sequence of continuous functions $\{g_n\}_{n=1}^\infty$ with $0 \le g_n \le 1$ such that $\lim_{n \to \infty} g_n(x) = \chi_E(x)$ for each $x \in B^c$
Now, to prove c), I can apply b) to get sequences $\{O_n\}$ and $\{F_n\}$ and let $B = (\cap_{n=1}^\infty O_n) \setminus (\cup_{n=1}^{\infty} F_n)$. For each pair $O_n$ and $F_n$, apply a) to get a continuous function $g_n$, then verify that $\lim_{n \to \infty} g_n(x) = \chi_E(x)$ for $x \in B^c$.
My question is that in b) I can find $\{O_n\}$ and $\{F_n\}$ such that $\cap_{n=1}^\infty O_n = \cup_{n=1}^{\infty} F_n = E$. However this would imply c) is true for all $x \in \mathcal{R}$ !
My definition of $\{O_n\}$ and $\{F_n\}$ that satisfy conditions in b) are the following:
$$ O_n = \{x: d(x,E) < \frac{1}{n} \}$$
and
$$ F_n = \{x: d(x,E^c) \ge \frac{1}{n} \} $$
where $d(x,\cdot)$ is distance function and is defined as $d(x,E) = \inf\{|x-y|: y \in E\}$