I'd like to know if my following proof for the integrabilty of Thomae's function in $[0,1]$ is correct: recall that $T:[0,1]\rightarrow\mathbb{R}$ is defined as
$$T(x)=\begin{cases} 0 & x\in[0,1]\setminus\mathbb{Q}\\ \frac{1}{q} & x=\frac{p}{q},\;p,q\text{ are coprime} \end{cases}$$
now, my argument is as follows: let $\varepsilon>0$. for every partition $P$ of $[0,1]$ the lower sum is $0$, so I wish to find a Partition $P$ such that
$$U(T,P)<\varepsilon$$
we'll denote the partition of $[0,1]$ to $n$ equal segments by $P_{n}$. now, we see that
$$U(T,P_n) =\sum_{i=1}^n M_i(T)\cdot\Delta x_i =\frac{1}{n}\sum_{i=1}^n M_i(T)$$
so now we need to understand the growth rate of the term $\sum_{i=1}^{n}M_{i}\left(T\right)$ : if $\phi(n)$ is euler totient function, so we can say that there are $\phi(m)$ values of $x$ such that $f(x)=1/m$. however, we know that for every natural number $m$, $\phi(m)<m$ so if look at
$$\sum_{i=1}^{S(n)} M_i(T)$$
where $S(n)=\frac{n(n+1)}{2}$
we get that
$\sum_{i=1}^{S(n)}M_i(T)<n+1$ (including zero here)
since we have no more than $m$ of $\frac{1}{m}$ terms in the sum, so we have a $1$ from $M_{1}(T)$ and a $1$ from $M_{n}(T)$, and the next 2 biggest terms must add up to something strictly smaller than 1, since $\frac{1}{2}$ appears less than twice, and the next three biggest terms after those two must also add up to something smaller than $1$, because we already added the terms that could be $\geq\frac{1}{2}$, so all those three terms must be $\le\frac{1}{3}$ but there are less than three $\frac{1}{3}$ appearances and the inequality above follows by induction.
so, it follows that
$$U\left(T,P_{S(n)}\right)=\frac{2}{n(n+1)} \sum_{i=1}^{S\left(n\right)} M_i(T)<\frac{2}{n}$$
now, for $N$ large enough we get a partition $P_{S(N)}$ like we want.
I think this proof is quite nice, But I'd like to hear your opinions and of course to know whether it is correct. thank you!