I need to decide if the following integral converges or not :
$$\int_0^\infty \sin(\sin(x))dx$$
I am pretty sure it diverges. I was told to prove it by using the fact that for $k=0,1,2,\cdots$, then $\lvert x -2k\pi\rvert \geq \lvert \sin(x) \rvert \geq \frac{\lvert x -2k\pi \rvert }{2}$ for $\lvert x -2k\pi\rvert$ small enough. I thought of using some criteria on comparison of improper integrals but the absolute values I was given makes it weird because if the integral is not absolutely convergent does not mean the integral diverges.
Let $f : [0, \infty) \to \Bbb R$ be continuous and periodic with $1$ as a period. Suppose that $\displaystyle\int_0^\infty f$ converges.
Claim 1. $\int_0^1 f = 0.$
Proof. By periodicity, we have that $$\int_0^N f = N \int_0^1 f$$ for all $N \in \Bbb N$. Since the improper integral exists, the above must have a limit as $N \to \infty$. This is possible iff $\int_0^1 f = 0$. $\Box$
Claim 2. $\int_0^\infty f = 0$.
Proof. Since the above integral is assumed to exist, we may take the top limit to go to infinity however we want. In particular, we have $$\int_0^\infty f = \lim_{\substack{N \to \infty \\ N \in \Bbb N}} \int_0^N f = 0.$$
Claim 3. $\int_0^t f = 0$ for all $t \in [0, \infty)$.
Proof. Fix $t \in [0, \infty)$. For $N \in \Bbb N$, note that \begin{align} \int_0^{N + t} f &= \int_0^N f + \int_N^{N + t} f \\ &= 0 + \int_0^t f. \end{align}
Again, taking $N \to \infty$ gives the result. $\Box$
Claim 4. $f \equiv 0$, i.e., $f$ is the constant function taking the value $0$.
Proof. Here is where we use continuity for the first time. Let $$F(x) = \int_0^x f.$$ Then, $F$ is identically $0$, by the previous claim. Since $f$ is continuous, we have $F' = f$ and thus, $f \equiv 0$. $\Box$
Of course, I can change the period to $2 \pi$ as well. In that case, we get that your integral diverges.
Note that continuity was important, otherwise I can take something like the indicator function of $\Bbb N$. That has integral $0$ but the function does not even vanish at $\infty$.
Moreover, periodicity is also important. For example, there do non-negative continuous functions $f : [0, \infty) \to [0, \infty)$ such that $\displaystyle\int_0^\infty f$ converges but $f$ does not have a limit at $\infty$.