I'd like to know if the following reasoning to prove that $f(x)=\sin x$ is not integrable is correct, or what's the mistake I'm making.
Consider the following definition and Corollary taken from Folland's Real Analaysis:
Definition: Consider a measure space $(X,M, \mu)$. If $f:X \to \Bbb R$, we say that $f$ is integrable if both $\int_X f^+$ and $\int_X f^-$ are finite. It is clear that $f$ is integrable iff $\int_X |f|<\infty$ since $|f|=f^+ + f^-$.
Corollary 2.2: If $X$ and $Y$ are topological spaces, every continuous $f:X\to Y$ is $(B_X, B_Y)$-measurable, where $B_X$ and $B_Y$ are the Borel $\sigma$-aglebras on $X$ and $Y$, respectively.
Now, the function $f:\Bbb R \to \Bbb R$ defined by $f(x)=\sin x$ is continuous, and by the corollary, it's Borel-measurable.
We have that $\int_{\Bbb R} f = \int_{-\infty}^\infty \sin (x) dx = 0$, but $\int_{\Bbb R} f^+= \int_{\Bbb R} f^-=\infty$, so, $f(x)=\sin x$ is not integrable.
Note: I'm doing this because I'm trying to understand why do we have $\int_X |f|<\infty$ and not $\int_X f<\infty$ in the definition of integrable function, and I'm trying to find a counterexample that $\int_X f<\infty$ doesn't imply $\int_X |f|<\infty$. If someone has a valid counterexample it would be nice to know it.