Show that $ f_n $ is discontinuous at $ \mathbb Q $. For every $n\in\mathbb N$ and $x\in [0,1]$, let $f_n$ define by $$f_n(x)=\begin{cases} 1, &\text{ if } x=p/q\in\mathbb Q,\gcd(p,q)=1\ \text{and}\ q\leq n; \\ 0, &\text{ other case } \end{cases}.$$
What I want to prove is that the points of discontinuity of this function have a measure of $ 0 $ according to Lebesgue. The set of discontinuity points $ D_{f_n} $ of this function is $ D_{f_n} = [0,1] \cap \mathbb Q $, which is a countable set and therefore has a measure of $ 0 $ according to Lebesgue.
I have tried to guide myself with this page for the test: "https://en.wikipedia.org/wiki/Thomae%27s_function".
But there the function has the change of $ 1 / q $, and they use the Archimedean property for that, and here everything gets upset because I don't have that here. Who help me?
 A: For every $n$ the set $A_n=\{\frac{p}{q} | \quad 0\leq \frac{p}{q}\leq1 \text{ and } \}$ is a finite set.
Your function $f_n$ is just the indicator function of $A_n$, so we can just prove this lemma:
Let $A$ be a finite subset of $[0,1]$, then the indicator function of $A$ (which we denote $1_A$) is discontinuous exactly at the points of $A$.
Proof: We first prove $\lim\limits_{x\to x_0}1_A(x) = 0$ for all $x_0\in A$. To do this, given $\varepsilon>0$, we can just take $\delta$ equal to the smallest distance between $x_0$ and the closest point of $A$ that isn't $x_0$.
Once we have found these limits it is clear that the function does not coincide with the limit exactly at the points that belong to $A$.
I now suspect that maybe you have to prove that the set $D$ of points that are discontinuities for at least on of the functions has measure $0$, and in this case we can just use the above to see that $D=\mathbb Q$, and so indeed it does have measure $0$.
A: Your function has at most finitely many discontinuities. Specifically, all points $x = p/q$ where $f(x) = 1$ will have $0 \leq p, q \leq n$. So you'll have at most $n^2$ points. (More precisely, you'll have about $\sum_{m \leq n} \varphi(m) \sim \frac{6}{\pi^2} n^2$ points).
As you have finitely many such points, their measure is $0$.
