Theorem
Let $|f(x)|<g(x)$ $\forall x \in [a,b)$. If integral $\int_{a}^{b}{g(x)dx}$ converges then $\int_{a}^{b}{|f(x)|dx}$ also converges.
Proof
Since $\int_{a}^{b}{g(x)dx}$ converges, then we could say that $\forall \varepsilon$ $\exists \delta\in (a,b)$, such that $\forall b_1,b_2\in(\delta,b)$ holds $\left|\int_{b_1}^{b_2}{g(x)dx}\right|<\varepsilon$. Since $\int_{b_1}^{b_2}{g(x)dx}<\left|\int_{b_1}^{b_2}{g(x)dx}\right|$, we can see that $\forall \varepsilon$ $\exists \delta\in (a,b)$, such that $\forall b_1,b_2\in(\delta,b)$ holds $\int_{b_1}^{b_2}{g(x)dx}<\varepsilon$.
Functions $|f| and g$ are integrable for all segments $[a,x]\subset[a,b)$, thus they are integrable on $[a,b_2]$ and then also on $[b_1,b_2]\subseteq[a,b)$. Hence $\int_{b_1}^{b_2}{|f(x)|dx}\le\int_{b_1}^{b_2}{g(x)dx}<\varepsilon$.
So we can state that $\forall \varepsilon$ $\exists \delta\in (a,b)$, such that $\forall b_1,b_2\in(\delta,b)$ holds $\left|\int_{b_1}^{b_2}{g(x)dx}\right|\le\int_{b_1}^{b_2}{|f(x)|dx}<\varepsilon$. Which means integral $\int_{a}^{b}{|f(x)|dx}$ converges.$\blacksquare$
So I've been told this theorem is incorrect (sadly, I forgot which textbook it is from). So I tried to find a contradiction by myself. A simple example would be Dirichlet function on $[1,2)$ for example. So let's say \begin{equation} f(x)= \begin{cases} 1 & \text{if } x \in [1,2)\cap\mathbb{Q}\\ 0 & \text{if } x \in [1,2)\setminus\mathbb{Q} \end{cases} \end{equation} $$g(x)=x$$ We obviously know that Dirichlet function is not integrable. We can see that $|f(x)|\le g(x)$, $\forall x\in[1,2)$. It's is easly show that $\int_{1}^{2}{g(x)dx}$ converges and from the theorem that $\int_{1}^{2}{|f(x)|dx}$ also converges, which is obviously incorrect.
Have I possibly missed something here?
What way could we modify this theorem so the statment "If integral $\int_{a}^{b}{g(x)dx}$ converges then $\int_{a}^{b}{|f(x)|dx}$ also converges" is true? And how would that affect the proof?
Would something like the following modification be true?
Theorem
Let $|f(x)|<g(x)$ $\forall x \in [a,b)$. If $g$ and $f$ are integrable on segment $[a,\beta]\subset[a,b)$, then we could say that if integral $\int_{a}^{b}{g(x)dx}$ converges then $\int_{a}^{b}{|f(x)|dx}$ also converges.
If this is true, would the proof be the same, as that of the original (wrong) theorem?