Here is a general statement:
Proposition. Let $g : (0, \infty) \to \mathbb{R}$ be a locally integrable function such that
$$ I(s) = \int_{0}^{\infty} \frac{g(x)}{x^s} \, \mathrm{d}x = \lim_{\substack{a \to 0^+ \\ b \to \infty}} \int_{a}^{b} \frac{g(x)}{x^s} \, \mathrm{d}x $$
exists and is finite at $s \in \{0, \delta\}$ for some $\delta > 0$. Then $I(s)$ exists for any $s \in [0, \delta]$ and
$$ \lim_{s \to 0^+} I(s) = I(0). $$
We first illustrate a quick proof. If we write
$$ \int_{0}^{\infty} \frac{g(x)}{x^s} \, \mathrm{d}x
= \int_{0}^{1} \frac{g(x)}{x^{\delta}}x^{\delta-s} \, \mathrm{d}x + \int_{1}^{\infty} g(x)x^{-s} \, \mathrm{d}x, $$
then the right-hand side can be handled by the abelian theorem for the Laplace transform via suitable substitution.
Next we provide a more self-contained proof:
Step 1. Since $g$ is locally integrable, it admits an antiderivative $G : (0, \infty) \to \mathbb{R}$. Also, by noting that
$$ \int_{a}^{b} g(x) \, \mathrm{d}x = G(b) - G(a) $$
and it converges as $a\to0^+$ and $b\to\infty$, we find that both
$$ G(0^+) = \lim_{a\to0^+} G(a) \qquad\text{and}\qquad G(\infty) = \lim_{b\to\infty} G(b) $$
exist and are finite. Similarly, the map $x \mapsto g(x)x^{-\delta}$ admits an antiderivative $H : (0, \infty) \to \mathbb{R}$ with finite limits at both endpoints of $(0, \infty)$.
Step 2. Now let $s > 0$ and assume that $1 < b$. Then
\begin{align*}
\int_{1}^{b} \frac{g(x)}{x^s} \, \mathrm{d}x
&= \int_{1}^{b} g(x) \biggl( \int_{x}^{\infty} \frac{s}{u^{1+s}} \, \mathrm{d}u \biggr) \, \mathrm{d}x \\
&= \int_{1}^{\infty} \frac{s}{u^{1+s}} \biggl( \int_{1}^{b\wedge u} g(x) \, \mathrm{d}x \biggr) \, \mathrm{d}u \\
&= \int_{1}^{\infty} \frac{s}{u^{1+s}} \bigl( G(b\wedge u) - G(1) \bigr) \, \mathrm{d}u.
\end{align*}
Since $G$ is bounded, letting $ b \to \infty$ and applying the dominated convergence theorem shows that the both sides converge to
\begin{align*}
\int_{1}^{\infty} \frac{g(x)}{x^s} \, \mathrm{d}x
&=\int_{1}^{\infty} \frac{s}{u^{1+s}} \bigl( G(u) - G(1) \bigr) \, \mathrm{d}u.
\end{align*}
Then substituting $u = y^{1/s}$,
\begin{align*}
\int_{1}^{\infty} \frac{g(x)}{x^s} \, \mathrm{d}x
&= \int_{1}^{\infty} \frac{1}{y^{2}} \bigl( G(y^{1/s}) - G(1) \bigr) \, \mathrm{d}u.
\end{align*}
So by the dominated convergence theorem again, it follows that
\begin{align*}
\lim_{s\to0^+} \int_{1}^{\infty} \frac{g(x)}{x^s} \, \mathrm{d}x
= \int_{1}^{\infty} \frac{1}{y^{2}} \bigl( G(\infty) - G(1) \bigr) \, \mathrm{d}u
= G(\infty) - G(1).
\end{align*}
Step 3. Similarly, for $s < \delta$ and $0 < a < 1$,
\begin{align*}
\int_{a}^{1} \frac{g(x)}{x^s} \, \mathrm{d}x
&= \int_{a}^{1} \frac{g(x)}{x^{\delta}} x^{\delta-s} \, \mathrm{d}x \\
&= \int_{a}^{1} \frac{g(x)}{x^{\delta}} \biggl( \int_{0}^{x} (\delta - s) u^{\delta-s-1} \, \mathrm{d}u \biggr) \, \mathrm{d}x \\
&= \int_{0}^{1} (\delta - s) u^{\delta-s-1} \biggl( \int_{a \vee u}^{1} \frac{g(x)}{x^{\delta}} \, \mathrm{d}x \biggr) \, \mathrm{d}u \\
&= \int_{0}^{1} (\delta - s) u^{\delta-s-1} \bigl( H(1) - H(a\vee u) \bigr) \, \mathrm{d}u
\end{align*}
and letting $ a \to 0^+$ shows that both sides converge to
\begin{align*}
\int_{0}^{1} \frac{g(x)}{x^s} \, \mathrm{d}x
&= \int_{0}^{1} (\delta - s) u^{\delta-s-1} \bigl( H(1) - H(u) \bigr) \, \mathrm{d}u.
\end{align*}
Also, appealing to the dominated convergence theorem again, the right-hand side is continuous for $s < \delta$ and hence the same is true for the integral in the left-hand side.
Conclusion. Altogether, we have shown that $I(s)$ exists for $s \in (0, \delta)$ and that
\begin{align*}
\lim_{s \to 0^+} I(s)
&= \lim_{s\to0^+} \int_{0}^{1} \frac{g(x)}{x^s} \, \mathrm{d}x
+ \lim_{s\to0^+} \int_{1}^{\infty} \frac{g(x)}{x^s} \, \mathrm{d}x \\
&= \int_{0}^{1} g(x) \, \mathrm{d}x + \left( G(\infty) - G(1) \right) \\
&= I(0).
\end{align*}
Best Answer
Your questions are the point of the exercise. We define $$\int_{-\infty}^{\infty}f(x) \Bbb dx = \lim_{b \to \infty} \int_{-b}^{0}f(x) \Bbb dx+ \lim_{b \to \infty} \int_{0}^{b}f(x) \Bbb dx$$ which requires that each limit exist separately. You have shown that one of them diverges, which means the left side diverges as well. When you take the symmetric limit $ \lim_{b \to \infty} \int_{-b}^{b}f(x) \Bbb dx$ you are integrating an odd function over an interval symmetric around $0$, so the integral is constantly $0$ and converges nicely. The problem is that this is an artifact of the use of the symmetric interval. You could do a $u$ substitution that makes the interval asymmetric in $x$ and the integral will diverge. This is why we require that the one sided limits converge separately.
In the case where the symmetric limit converges we call the limit the Cauchy principal value. It is sometimes useful.