# For a given step function and a given $\epsilon>0$ construct a continuous function which agree outside a set of measure less than $\epsilon$.

Let $\psi : \mathbb R \longrightarrow \mathbb R$ be a given step function.Then for a given $\epsilon > 0$ show that there exists a continuous function $f : \mathbb R \longrightarrow \mathbb R$ such that the set $\{x \in \mathbb R : f(x) \neq \psi(x) \}$ has measure less than $\epsilon$.

How can I construct such a function $f$? Please help me.

Hint 1. If $$\psi(x) = \begin{cases} -1, & x < 0 \\ 1, & x > 0 \end{cases}$$ we can define, for $n\in\mathbb N$, $$f_n(x) = \begin{cases} -1, & x < -1/n \\ nx, & x\in[-1/n,1/n] \\ 1, & x> 1/n, \end{cases}$$ which is continuous and satisfies $\mu(\{f \neq \psi\}) = 2/n$. Now just choose $n$ such that $2/n < \epsilon$.
Hint 2. If $g$ is a step function, its set of discontinuity points is countable.