Suppose $f_n(x), f(x)$ are continuous on $[0,1]$ and $\lim_{n\to \infty}f_n(x)=f(x)$ for all $x\in [0,1]$. Since the convergence is not necessarily uniform, there must exist a counterexample to the fact that $$\lim_{n\to\infty} \int_0^1 f_n(x)dx=\int_0^1f(x)dx$$ but I couldn't come up with any. I don't even understand what properties should $f_n$ have to begin with (except that this sequence is not uniformly convergent).
After I finished typing this question, I found this in similar questions. But I'm still wondering how could one come up with such a counterexample or how to come up with a different counterexample? What should I bear in mind to construct it? Obviously the key idea is that the limit of the integral is not the integral of the limit, but what subideas can I exploit?