I want to find a sequence of functions say $f_1 , f_2, \ldots$ such that each $f_n : [0,1] \to [0,+\infty)$ is a Borel measurable function with the limit $f(x)=\lim_{n \to \infty} f_n(x)$ existing for every $x \in [0,1]$, but we have the condition that $\int_{0}^{1} f(x) dx \neq \lim_{n \to \infty} \int_{0}^{1} f_n dx$.
Now intuitively my first thought was to look at a function such as $$f_n(x)=\frac{1}{\left(x+\frac{1}{n}\right)},$$ since the integral of each $f_n$ is well defined as $\log(n+1)$, giving $$\lim_{n\to \infty}\int_{0}^{1}f_n(x) dx=\log(1)=0$$ but then as $\lim_{n \to \infty} f_n(x) = f(x) = \frac{1}{x}$, $$\int_{0}^{1} f(x) dx = \log(1)-\log(0)$$ and so is undefined, and so satisfying the condition.
My issue is that I have assumed here that $\int \frac{1}{x} dx = \log(x)$, but I feel like I was supposed to show that this was the case using the integral defined over the Lebesgue measure, given that the question is set in the context of measure theory. I am not sure if I have learned how to do this yet so any help would be greatly appreciated!