This problem has been discussed before, but I tried to write a more detailed proof based on this answer.
Problem: prove that $\displaystyle\lim_{n\to\infty}f_n(x)$ does not exist for any $x\in [0,1]$ if the sequence $(f_n)_{n\in\Bbb N}$ of functions $f_n:\Bbb R\to\Bbb R$ is given by $$f_n=1_{\left[\frac{n-2^k}{2^k},\frac{n-2^k+1}{2^k}\right]},\text{ where }k=\left\lfloor\log_2 n\right\rfloor.$$
My attempt:
Let's write $n\in\Bbb N$ as $n=2^m+k,$ where $m\in\Bbb N\cup\{0\}$ and $k\in\{0,\ldots,2^m-1\}.$ Then, \begin{aligned}\frac{n}{2^k}-1&=\frac{2^{\log_2(2^m+k)}}{2^{\left\lfloor\log_2\left(2^m+k\right)\right\rfloor}}-1\\&=2^{\log_2\left(2^m+k\right)-\left\lfloor\log_2\left(2^m+k\right)\right\rfloor}-1\\&=2^{m+\log_2\left(1+\frac{k}{2^m}\right)-m}-1\\&=2^{\log_2\left(1+\frac{k}{2^m}\right)}-1\\&=\frac{k}{2^m}.\end{aligned}
We can now find an increasing sequence $\left(\frac{p_n}{q_n}\right)_{n\in\Bbb N}$ of fractions with $q_n$ being powers of $2$ s. t. $\displaystyle\lim_{n\to\infty}\frac{p_n}{q_n}=x,$ which shows that for each $x\in[0,1],$ there is a subsequence $\left(f_{p_n}\right)_{n\in\Bbb N}$ s. t. $f_{p_n}(x)=1,\forall n\in\Bbb N.$ On the other hand, if $a_n:=\frac{n-2^{k_n}}{2^{k_n}},k_n=\left\lfloor\log_2(n)\right\rfloor,$ and we consider the following subsequence: \begin{aligned}b_m:=a_{2^m-1}&=\frac{2^m-1}{2^{k_{2^m-1}}}-1\\&=\frac{2^m-1}{2^{\left\lfloor\log_2\left(2^m-1\right)\right\rfloor}}-1\\&=\frac{2^m-1}{2^{m-1}}-1\\&=\frac{2^{m-1}}{2^{m-1}}\cdot\left(2-2^{1-m}\right)-1\\&=1-2^{1-m},\\\lim_{m\to\infty}b_m&=1\end{aligned} we see that, for any given $x\in[0,1],$ there is a subsequence $\left(f_{q_n}\right)_{n\in\Bbb N}$ s. t. $f_{q_n}(x)=0,\forall n\in\Bbb N.$
Therefore, the limit $\displaystyle\lim_{n\to\infty}f_n(x)$ doesn't exist for any $x\in[0,1].$
Is there anything wrong with my deduction and how can I improve my answer?