Does there exist a sequence of step functions which converge pointwise to the Dirichlet function? There is already a similar question here on MSE except the op asked for an increasing sequence. This is quickly seen to be false, so I'm asking about a sequence which is not necessarily increasing. My intuition seems to be that there is no such sequence and I've tried to prove it but failed. The argument I was think of is that given a particular $x$ in $Q$ if a step function converges to it then for an irrational point "near enough" $x$ it shouldn't; however, since pointwise convergence depends on the point x (i.e. finding N depends on x) and the sequence of step functions isn't necessarily increasing, I got stuck in attempting to prove it. Perhaps my intuition is wrong and I would appreciate help answering this question.
 A: I have an answer but you’re not going to like it. Using Stein & Shakarchi’s definitions, a step function is a function $S:\mathbb{R}^n \rightarrow \mathbb{R}$ of the form:
$$S(x) = \sum_{j=1}^n \chi_{R_j}(x)$$
Where $\chi_A$ denotes the characteristic function of the set $A$, and $R_j$ is a rectangle for each $j$. The obvious question is “what exactly do Stein and Shakarchi mean by ‘rectangles’?”
On page 3, they write:

A (closed) rectangle $R$ in $\mathbb{R}^d$ is the product of $d$ one-dimensional closed and bounded intervals
$$R = [a_1, b_1] \times \cdots \times [a_d, b_d],$$
where $a_j \leq b_j$ are real numbers, $j=1,2, \dots d$.

Since we allow $a_j = b_j$, it follows that a singleton is a rectangle. Thus we may trivially take a sequence of step functions that converge pointwise to the Dirichlet function by taking:
$$S_n (x) := \sum_{j=1}^n \chi_{\{q_j\}}(x)$$
Where $\{q_n\}_{n \in \omega}$ is an enumeration of $\mathbb{Q}$.
I imagine you have already thought of this, and would like to avoid such “trivial” step functions.

In my comment, I mentioned a stack exchange post that indicates that for a set $B \subseteq \mathbb{R}$, the characteristic function $\chi_B$ is the pointwise limit of step functions if and only if $B$ is a $\mathbf{\Pi}^0_4$. I’m not exactly sure if this is true, but I imagine that the tools in Kechris’s book on Descriptive Set Theory may be helpful.
Assuming that result is true (big if), I’m curious if the result relies on these kinds of “trivial” step functions, or if they can be avoided.
