I was asked to prove or disprove the following:
If $\int_{1}^{\infty}f(x)dx$ converges then $\lim_{x\to\infty}f(x) = 0$.
I said that this is false and gave this example:
$f(x) = \left\{ \begin{array}{ll} 1 & \mbox{if } x \in \mathbb{Q} \\ -1 & \mbox{if } x \notin \mathbb{Q} \end{array} \right.$
$\int_{1}^{\infty}f(x)dx = 0$ and $\lim_{x\to\infty}f(x)$ does not exist.
Was my example correct? And could anyone please elaborate more on this topic and write a little about how I should think in case I encounter similar T/F questions in the future?