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.
Best Answer
$f(x) = \sin^{-1} x$ has $f'(x)=(1-x^2)^{-1/2}$ which is unbounded, but $L^1$ (well it's Riemann integrable anyway).