Restrict the domain to [0,1] (without this restriction the finiteness below fails). For each n≥1 let Sn={p/q∈[0,1]:1≤q≤n, gcd(p,q)=1}. This is a finite set: there are only finitely many pairs (p,q) with 0≤p≤q≤n.
Define fn(x)=maxr∈Snmax(0,1/q(r)−n∣x−r∣) on [0,1], where q(r) is the denominator of r=p/q. Each tent x↦max(0,1/q−n∣x−r∣) is continuous, and a finite maximum of continuous functions is continuous, so each fn is continuous.
Let x=a/b∈[0,1] in lowest terms. For n≥b, the tent at r=x∈Sn itself gives the value 1/b, while for any other r′=p/q∈Sn with r′=x and q≤n we have ∣x−r′∣≥1/(bq) (distinct rationals with denominators b,q differ by at least 1/(bq)), so n∣x−r′∣≥n/(bq)≥1/q — the tent value is 0. Hence fn(x)=1/b=f(x) for n≥b.
If x∈[0,1] is irrational, f(x)=0. Fix M≥1: tents with denominator q≤M all vanish for large n (there are only finitely many rationals in [0,1] with denominator ≤M, each at positive distance from the irrational x), and tents with q>M are worth at most 1/q<1/M.
Hence limsupn→∞fn(x)≤1/M; since M is arbitrary, fn(x)→0=f(x). So fn→f at every x∈[0,1]: Thomae's function is Baire class 1 on [0,1].