Dirichlet Function Pointwise Convergence We say that a function $f$ is Baire Class $1$ if there is a sequence of functions $f_i \to f$ pointwise where each $f_i$ is continuous.

The set of discontinuities of a Baire Class $1$ function $f$ must be a first-category (meagre) set of points.

The Dirichlet function $f(x) = \begin{cases} 1 &amp; x \in \mathbb Q \\ 0 &amp; x \notin \mathbb Q \end{cases}$ is not Baire class $1$ since it is discontinuous everywhere.

But can't we write the function as $f_i(x) = \lim_{i\to\infty} \cos(i!\pi x)^{2i}$, each of which is a continuous function that converges pointwise to the Dirichlet function?  What is wrong with this?
Let $0\le n_1&lt;n_2&lt;...&lt;n_k&lt;\dots$ and define $$x=2\sum_{j=1}^\infty \frac{1}{n_j!}$$

Basically, we will pick $\{n_i\}$ to grow "fast enough" so that $\limsup_i \left(\cos n_i!\pi x\right)^{2n_i}&gt;0$

Now $n_i!x = 2K + 2\sum_{j&gt;i} \frac{n_i!}{n_j!}$ for some integer $K$.  And:$$0\leq \sum_{j&gt;i} \frac{n_i!}{n_j!} &lt; \frac{2}{n_i^{n_j-n_i}}(1+\frac{1}{n_j}+\frac{1}{n_j^2}+..) = \frac{2}{n_i^{n_j-n_i}}\frac{n_j}{n_j-1}$$

So $n_i!x\pi = 2K\pi + z$ where $0\leq z &lt; \frac{2\pi}{n_i^{n_j-n_i}}\frac{n_j}{n_j-1}$.

It's gonna be a little messy, but if you choose a reasonable sequence of $n_i$, then you'll be able to show that $$\limsup_{i\to\infty}\left(\cos n_i!\pi x\right)^{2n_i}&gt;0 $$

In particular then, $\left(\cos j!\pi x\right)^{2j}$ cannot converge to zero.
The set of discontinuities of a Baire Class 1 function f must be a first-category (meagre) set of points. Hence Dirichlet is not Baire 1
$f(x)=\lim_{i\to\infty} \lim_{j\to\infty} (\cos(i!πx)^{2j})$. This proves Dirichlet function is Baire 2 function.