Conditional convergence of $\int_{0}^{\infty}(-1)^{[ x^2]}dx$ I'm trying to prove that the following integral $\int_{0}^{\infty}(-1)^{[ x^2]}dx$ is conditional converges, ( The brackets stand for the floor function). I can't use the integral test since this is clearly not a positive function, but I'd like somehow to do an analog to  Leibniz series and use it, I'm not sure how. 
Any suggestions?
Thank you!

Let $f(x)=(-1)^{[x^2]}$. Then $f(x)$ is constant on the intervals $[\sqrt{n-1},\sqrt{n})$, when $n$ is a positive integer.   The value of $$\int_{\sqrt{n-1}}^{\sqrt{n}} (-1)^{[x^2]}dx$$ is $$(-1)^{n-1}(\sqrt{n}-\sqrt{n-1})$$
So, for any $n$, $$\int_0^{\sqrt{n}} = \int_{\sqrt 0}^{\sqrt{1}} + \int_{\sqrt{1}}^{\sqrt 2}... + \int_{\sqrt{n-1}}^{\sqrt{n}}$$
So $$\int_{0}^{\sqrt n} (-1)^{[x^2]} dx = \sum_{k=0}^{n-1} (-1)^k (\sqrt{k+1}-\sqrt{k})$$
But $a_k = \sqrt{k+1}-\sqrt{k}$ is strictly decreasing and converges to 0, and therefore $\sum (-1)^k a_k$ converges.
The only question then is what to do with the $\int_0^{z}$ when $z$ is not a perfect square root.
