I know that the function
$$f(x) = \begin{cases} 1&\text{if } x \in \mathbb{Q}\\ 0&\text{if } x \notin \mathbb{Q} \end{cases}$$
is not integrable. Then how would I come up with a new function $g(x)$ such that $g(x)$ is not integrable but $|g(x)|$ is integrable? First, if a function is absolutely integrable, then I think the function should be integrable.
What about:
$$f(x) = \begin{cases} 1&\text{if } x \in \mathbb{Q}\\ -1&\text{if } x \notin \mathbb{Q} \end{cases}$$