Does a continuous function $f: [1, \infty) \to [0,\infty)$ exist, such that $\sum_{k=1}^\infty f(k)$ converges but $\int_1^\infty f(x)\,dx$ does not converge?
I need help coming up with an example. If $\sum_{k=1}^\infty f(k)$ converges, we know that $f(k) \xrightarrow[k \to \infty]{}0$. I tried to come up with a function that's constant $0$ on the natural numbers, so the convergence of the series is guaranteed. One idea was $|\sin(x \pi)|$, which also shows that $f$ itself doesn't necessarily need to converge, however I have no idea how to integrate that (Intuitively that integral shouldn't converge though). If there is an elementary example where it's really easy to see why it's true, I would appreciate it.