Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Just to remark that the denominator of $u_{n+1}$ is a factor of the denominator of $u_n$, so a counterexample would end up on infinitely many rational numbers all with the same denominator.
Regarding the Bonus question, is there a counter-example to the (naïve, but natural) conjecture that $\alpha$ is rational if and only if the sequence $(a_n)$ is eventually constant? (The less interesting "if" direction isn't difficult to prove.)
Hm, apparently $p_n/(n\log n)$ decays to $1$ rather slowly (it behaves like $1+\frac{\log\log n}{\log n}$), so I take back my guess that an improvement of PNT will show that (2) is false.
Replacing $p_n$ with $n\log n$ in (2) yields a false inequality for all large $n$. I'm guessing that some improved form of the prime number theorem may imply that (2) is false.
When $m$ is large, for $2^m$ to equal $f(n)$ it must be that $n=\lfloor \sqrt[4]{24\cdot2^m}+1.5\rfloor$. A quick check on mathematica with $m\leq 10000$ found no solution; this means for every $n$ smaller than about $10^{250}$ (and bigger than 10) that $f(n)$ is NOT a power of $2$.
@YCor I was thinking of compact Hausdorff (I should have said totally disconnected is not needed) but now that you mention it I think locally compact should be enough. All that's needed is existence of Haar measure and denseness in $L^2$ of compactly supported continuous functions.