Let $a<b$ be real numbers. We say that a function $f:[a,b]\to\mathbb{R}$ is Baire $1$ if there exists a sequence of continuous functions $(f_n)_{n=1}^\infty$ that converges to $f$ pointwise.
Proposition: If $f:[a,b]\to\mathbb{R}$ is continuous everywhere except possibly countably many points, then $f$ is Baire $1.$
The following proof is provided by my lecturer.
Proof: Let $D_f$ and $C_f$ be set of discontinuities and continuities respectively. By assumption, $D_f$ is countable and $C_f$ is uncountable. Choose a countable dense subset $E_f$ of $C_f.$ Then $D_f\cup E_f$ is countable. List $D_f\cup E_f$ as $$s_1,s_2,...,s_n,....$$ We include $a$ and $b$ in the list. So it becomes $$a,b,s_1,s_2,...,s_n,...$$
We are going to construct $f_n.$ For $n=1,$ find large enough $n_1$ such that for any number $x$ in the list $$a,b,s_1,s_2,...,s_{n_1}$$ there is some $y$ in this list with $$|x-y|<\frac{1}{2}.$$ Let $f_1$ be a piecewise linear function on $[a,b]$ with respect to $$s_1,s_2,...,s_{n_1}.$$ For $n=k,$ choose large enough $n_k$ such that for any number $x$ in the list $$s_1,s_2,...,s_{n_1},...,s_{n_2},...,s_{n_k}$$ there is some $y$ in the list such that $$|x-y|<\frac{1}{2^k}.$$ Let $f_k$ be a piecewise linear function with respect to $$s_1,s_2,...,s_{n_k}.$$
The remaining proof tried to show that $(f_n)$ converges to $f$ pointwise.
Questions: $(1)$ Why can we choose a countable dense subset $E_f?$ Is it because $[a,b]$ is separable, and being a subset of separable in a metric space is also separable. If I want to construct $E_f$ by hand, what should I do?
$(2)$ Why does there exist $n_1$ such that for any $x$ in $$a,b,s_1,s_2,...,s_{n_1}$$ there is some $y$ in the same list with $|x-y|<\frac{1}{2^1}?$
$(3)$ What is an idea of construction continuous $f_n$? In particular, I do not see its 'picture'. For example, if $f$ has finitely many discontinuities, then for each of them, say $x_i,$ consider $(x_i-\epsilon,x_i+\epsilon)$ such that it does not contain other discontinuities. Then define $f_n$ to be a 'peak' function on the open interval and $f_n = f$ outside each of those open interval.
So, in this case the set $C_f$ is uncountable (in fact, co-countable.) This entails that for every open interval $I$ with rational end-points, the intersection $I \cap C_f$ is non-empty. Since the intervals with rational end-points form a countable base for the topology, if we simply select a single point from each of the intersections, the result will be countable and dense.
The process I've out-lined above, would be how one constructs the set $E_f$ "by hand."
Since the interval $[a,b]$ is compact; the open cover consisting of the open-balls centered at each $s_k$ having radius $\frac{1}{2^1}$, must have a finite sub-cover. Say, this sub-cover consists of the open-balls with centers, $s_{m_1}, s_{m_2}, \ldots, s_{m_j}$ then, taking $n_1 = \max \{ m_1, m_2, \ldots, m_j \}$ we have an integer which meets the stated requirements.
The functions $f_n$ are definable from only a finite fragment of $f$ (in particular it's values at the corresponding points $s_1, \ldots, s_k$.) This is a desirable property.