The answer given by @d.k.o. is almost correct: Let us assume that $\int_{A_n} X \, dP \not \to 0$. Then there is some $\epsilon > 0$ and a subsequence $A_{n_k}$ with $|\int_{A_{n_k}} X \, dP | \geq \epsilon$ for all $k$.
Now, since $P(A_n) \to 0$, we can choose a further subsequence $A_{n_{k_\ell}}$ (which we call $B_\ell$ for brevity) with $P(B_\ell) \leq 2^{-\ell}$. In particular, $\sum_\ell P(B_\ell) <\infty$, so that the Borel Cantelli lemma implies $P(B_\ell \text{ i.o.}) = 0$ ($B_\ell$ infinitely often). This means $\chi_{B_\ell} \to 0$ almost surely.
Now we can use the dominated convergence theorem to conclude
$$
\int_{B_\ell} X \, dP \to 0,
$$
which is in contradiction to $|\int_{A_{n_k}} X \, dP|\geq \epsilon$ for all $k$.