The precise meaning that a function $f$ is Lebesgue integrable on some measurable set $E$ is that both positive and negative parts, $f^+(x) = \max(f(x),0)$ and $f^-(x) = \max(-f(x),0)$, must have finite-valued integrals
$$\int_E f^+ < +\infty, \,\, \int_E f^- < +\infty$$
Since $f^+$ and $f^-$ are nonnegative and $|f| = f^+ +f^-$, Lebesgue integrability requires that $\int_E|f| < +\infty$.
In this case there is no problem with $x \mapsto 2x\sin\frac{1}{x^2}$ as this can be continuously extended at $0$ and so is both Riemann and Lebesgue integrable on $[0,1]$ and $[-1,0]$. Recall that a bounded function that is Riemann integrable on a bounded interval is always Lebesgue integrable.
On the other hand, $x \mapsto \frac{2}{x} \cos \frac{1}{x^2}$ is not Lebesgue integrable on $[0,1]$. If it were we could apply the change-of-variables $x \to \frac{1}{\sqrt{t}}$ and have
$$\int_1^\infty \frac{|\cos t|}{t} \, dt = \int_0^1 \frac{2}{x} \left|\cos \frac{1}{x^2}\right| \, dx < +\infty$$
However,
$$\int_1^\infty \frac{|\cos t|}{t} \, dt > \sum_{k=1}^\infty\int_{k\pi}^{k\pi + \pi} \frac{|\cos t|}{t} \, dt > \sum_{k=1}^\infty \frac{1}{k\pi +\pi}\int_{k\pi}^{k\pi + \pi} |\cos t| \, dt = \frac{2}{\pi}\sum_{k=1}^{\infty} \frac{1}{k+1} \\ = +\infty $$
since the harmonic series on the RHS is divergent.
Note that the improper (Riemann) integral, without the absolute value present,
$$\int_0^1 \frac{2}{x} \cos \frac{1}{x^2} \, dx $$
is convergent, but this does not enforce Lebesgue integrability.
For any $n$, the simple function $\sum_{k=1}^n \chi_{(0, 1/k]}$ is nonnegative and less than $f^+$, so the integral of $f^+$ is larger than $\sum_{k=1}^n \frac{1}{k}$ for any $n$.
Edit: For $x \in (0,1]$, we have $$\sum_{k=1}^n \chi_{(0,1/k]}(x) = \#\{k \in\{1,\ldots,n\} : k \le 1/x\} = \lfloor 1/x \rfloor \le 1/x = f^+(x)$$
and thus
$$\sum_{k=1}^n \frac{1}{k} = \int_0^1 \sum_{k=1}^n \chi_{(0, 1/k]}(x) \, dx \le \int_0^1 f^+(x) \, dx.$$
Best Answer
No, the integrand here is not Lebesgue integrable. To prove that $f : x↦ \frac{(-1)^{\lfloor 1/x\rfloor}}{x^2}$ is Lebesgue integrable, you have to prove that $f$ is measurable (this is the case here) and that $\int_0^1 |f(x)|\,\mathrm{d}x$ is finite. But $|f(x)| = \frac{1}{x^2}$, therefore, $$ \int_0^1 |f(x)|\,\mathrm{d}x = \int_0^1 \frac{\mathrm{d}x}{x^2} = \lim_{\varepsilon\to 0} \int_\varepsilon^1 \frac{\mathrm{d}x}{x^2} =\lim_{\varepsilon\to 0} \left(\frac{1}{\varepsilon}-1\right) = +\infty. $$
Your error comes from the fact that $\frac{1}{1/n} = n$ (actually I had difficulties to find it) so your last sum should be $$ \sum_{n=1}^\infty\left((n+1)-n\right) = \infty. $$