When I need to prove that $\int_{[0,\infty)}fd\mu<+\infty$ I usually think that if $\lim_{t\to\infty}\int_{[0,t]}fd\mu<\infty$ then $\int_{[0,\infty)}fd\mu$ must converge, but someone told me that argument was not correct (Cosider $\mu$ the Lebesgue measure).
That is why I am looking for an example of a continuous function $f:[0,\infty)\longrightarrow\mathbb R$ such that $\lim_{t\to\infty}\int_{[0,t]}fd\mu$ exists but $\int_{[0,\infty)}fd\mu$ is not defined.
So far I have not come up with any.