Prove there exists a function $f$ such that $\int_1^{\infty}f(x)\,dx\text{ converges, but }\int_1^{\infty}|f(x)|\,dx\text{ diverges.}$
Similarly, prove that there exists a function $g$ such that $\int_0^1 g(x)\,dx\text{ converges, but }\int_0^1|g(x)|\,dx\text{ diverges.}$
All I am able to understand in the first part, is to take an example. I am thinking of something like $(1/2)^n$? I am not sure how to account for the absolute values, and when they say prove, can I just find an example only? I am having trouble of thinking of such a function.