Counterexamples have been discussed in the comments.
However, this does hold if we have the condition that $f:[a,b] \to \mathbb{R}$ is real-analytic.
If $f$ is constant, it's immediately clear. If $f$ is not constant, then note that $f$ is bounded, so the image of $f$ is a subset of $[-M,M]$ for $M>0$. There are finitely many integers in $[-M,M]$, so the set $S=\{x \in [a,b] : f(x) \in \mathbb{Z} \cap [-M,M] \}$ must also be finite. This is an immediate consequence of Bolzano–Weierstrass and the principle of permeance. But the discontinuities of $\lfloor f \rfloor$ are a subset of $S$ which means $f$ must have at most finitely many discontinuities, which implies Riemann integrability.