Alternative approach using Fourier transforms:
Fix $\xi \in \mathbb{R}$. By the definition of the exponential function, we have
$$\sum_{n=0}^k \frac{(\imath t \xi)^n}{n!} f(t) \to e^{\imath t \xi} f(t)$$
as $k \to \infty$ for any $t \in [a,b]$. Moreover,
$$\left|\sum_{n=0}^k \frac{(\imath t \xi)^n}{n!} f(t) \right| \leq |f(t)| e^{|\xi| \max\{|a|,|b|\}} \in L^1([a,b])$$
for all $k \geq 0$. Therefore, we conclude from the dominated convergence theorem that
$$\hat{f}(\xi := \int_a^b e^{\imath \, t \xi} f(t) \, dt = \lim_{k \to \infty} \sum_{n=0}^k \frac{(\imath \xi)^n}{n!} \int_a^b t^n \cdot f(t) \, dt =\int_a^b f(t) \, dt.$$
Since $\xi \in \mathbb{R}$ is arbitrary, this shows that the Fourier transform $\hat{f}$ of $f \cdot 1_{[a,b]}$ equals the constant $c:= \int_a^b f(t) \, dt$. On the other hand, the Riemann-Lebesgue lemma states that $\hat{f} \in C_{\infty}$; in particular
$$c=\lim_{|\xi| \to \infty} |\hat{f}(\xi)| = 0.$$
Now the uniqueness of the Fourier transform yields $f=0$ (Lebesgue-)almost everywhere on $[a,b]$.