I am self-learning a bit of measure theory.
I want to show that some function $f:\mathbb{R}\rightarrow\mathbb{R}$ is not integrable. I have $$ \int_\mathbb{R}f=\int_\mathbb{R}f^+ - \int_\mathbb{R}f^- $$ and, as I understand, I must show that bot integrals on the RHS diverge to $\infty$. If at least one of them does not, then $f$ is integrable (the value of the integral being $+\infty$ or $-\infty$).
However, in Showing $\frac{\sin x}{x}$ is NOT Lebesgue Integrable on $\mathbb{R}_{\ge 0}$, the accepted answer only proves that one of them diverges. How come?
You are right, it would have been better if in that reply they had separated $n$ into even and odds. If $n=2k$ you get $$\int_{(2k-1)\pi}^{2k\pi}\frac{(\sin x)^-}{x}dx\ge \frac{1}{k\pi}$$ and so if you sum over all $k$ you get that $$\int_{0}^{\infty}\frac{(\sin x)^-}{x}dx=\infty.$$ Similarly, if you take $n=2k-1$ you get $$\int_{(2k-2)\pi}^{(2k-1)\pi}\frac{(\sin x)^+}{x}dx\ge \frac{2}{(2k-1)\pi}$$ and so if you sum over all $k$ you get that $$\int_{0}^{\infty}\frac{(\sin x)^+}{x}dx=\infty.$$ Edit: Alternatively, you need to prove that the improper Riemann integral of $\frac{\sin x}{x}$ exists. This can be done by integrating by parts $$\int_{\pi/2}^t \frac{\sin x}{x}dx=-\frac{\cos t}{t}-\int_{\pi/2}^t \frac{\cos x}{x^2}dx.$$ Then $-\frac{\cos t}{t}\to 0$ as $t\to\infty$ and $\left\vert \frac{\cos x}{x^2}\right\vert \le \frac1{x^2}$ which is integrable in $[\pi/2,\infty)$. Hence, the improper Riemann integrable exists. This together with $$\int_0^\infty \frac{|\sin x|}{x}dx=\infty$$ implies that $$\int_{0}^{\infty}\frac{(\sin x)^+}{x}dx=\int_{0}^{\infty}\frac{(\sin x)^-}{x}dx=\infty.$$ PS: Jason is right. To prove that a function is not Lebesgue integrable it suffices to prove that $\int|f|=\infty$ (but if you want to give an example for that, just use $f(x)=\frac1{x}$ in $(1,\infty)$. To prove that the Lebesgue integral of a function does not exist, you need to prove that $\int (f)^+=\int (f)^-=\infty$. This follows either by direct computation, or, if appropriate, as in this case, if the proper Riemann integrable is finite and $\int|f|=\infty$