Let $\lambda$ denote Lebesgue measure on $\mathbb{R}$. Give an example of a continuous function with $\lim_{t\rightarrow\infty}\int_{[0,t]}f \,d\lambda$ exists but $\int_{[0,\infty)}f \,d\lambda$ is not defined.
I've been thinking about this for a bit now. I think the function $f(x)=\sin(x)/x$ (with $f(0):=0$ works out, but I'm wondering if there are any other simple examples that I'm overlooking.
Any conditionally convergent series will give you examples.
Recally that a series $\sum_{n=1}^\infty a_n$ is conditionally convergent if \begin{align} & \lim_{N\to\infty} \sum_{n=1}^N a_n \text{ exists in $\mathbb R$, thus it is not } {+\infty} \text{ or } {-\infty} \\ \text{and } & \lim_{N\to\infty} \sum_{n=1}^N |a_n|=+\infty. \end{align} An example is the alternating harmonic series $\sum_{n=1}^\infty(-1)^n/n.$
Now let $f$ be a function from $(0,\infty)$ into $\mathbb R$ for which $\displaystyle \int_n^{n+1} f(x)\, dx = (-1)^n/n.$