continuous function on a set of measure zero If $g:\mathbb{R}\longrightarrow\mathbb{R} $ whose set of discontinuities is $\mathbb{N}$.Show that $\forall \varepsilon >0,\exists f:\mathbb{R}\longrightarrow\mathbb{R} $ a continuous function such that $m\left( \left\{ x:f\left( x \right) \neq g\left( x \right)  \right\}  \right) <\varepsilon $
 A: Let $\{x_1,x_2,\dots\}$ be the discontinuities of $g$. For any $\epsilon>0$, define 
$$
f_\epsilon(x)= \left\{
\begin{array}{ll}
\frac{g(x_i+\frac{\epsilon}{2^{i+1}})-g(x_i-\frac{\epsilon}{2^{i+1}})}{\frac{\epsilon}{2^i}}
(x-x_i+\frac{\epsilon}{2^{i+1}})+g(x_i-\frac{\epsilon}{2^{i+1}}),\quad {\rm{if}}\quad x\in (x_i-\frac{\epsilon}{2^{i+1}},x_i+\frac{\epsilon}{2^{i+1}})\\
g(x),\quad {\rm{otherwise.}}
\end{array}
\right.
$$
Then it is clear that
$$
m(\{x:g(x)\neq f_\epsilon(x)\})\leq m(\bigcup_{i=1}^\infty(x_i-\frac{\epsilon}{2^{i+1}},x_i+\frac{\epsilon}{2^{i+1}}))\leq \sum_{i=1}^{\infty} \frac{\epsilon}{2^i}=\epsilon.
$$
A: You construct $f$ by replacing $g$ with a line around the discontinuities. The trick here is to have different width of the replacement. You replace the values of $g$ on the interval $(j-2^{-j}\epsilon/4, j+2^{-j}\epsilon/4)$ for each discontinuity at $j$.
That is
$$f(x) = \begin{cases}
{\left(1-{x-j\over  2^{-j}\epsilon/4}\right)g\left(j-2^{-j}\epsilon/4\right)
+ \left(1+{x-j\over 2^{-j}\epsilon /4}\right)g\left(j+2^{-j}\epsilon/4 
\right)\over 2} & \text{ if } |x-j|<2^{-j}\epsilon/4 \\
g(x) & \text{ otherwise }
\end{cases}$$
