The problem with this integral is that the function approaches infinity at $0$. For this type of problem, you must treat each side of $0$ separately. We write:
$$
\int_{-1}^1\frac{1}{x}dx=\lim_{a\rightarrow 0^+}\int_a^1\frac{1}{x}dx+\lim_{b\rightarrow 0^-}\int_{-1}^b\frac{1}{x}dx.
$$
Observe that we use a different limit for each infinite side. One can check that each of these limits diverge, for instance,
$$
\lim_{a\rightarrow 0^+}\int_a^1\frac{1}{x}dx=\left.\lim_{a\rightarrow 0^+}\ln(x)\right|^1_a=\lim_{a\rightarrow 0^+}(ln(1)-ln(a))=\infty.
$$
Similarly, the other integral is
$$
\lim_{b\rightarrow 0^-}\int_{-1}^b\frac{1}{x}dx=\left.\lim_{b\rightarrow 0^-}\ln(|x|)\right|^b_{-1}=\lim_{b\rightarrow 0^-}(ln(-b)-ln(1))=-\infty.
$$
Therefore, the entire expression above is an indeterminate form of $\infty-\infty$. In general, if any part of an integral diverges, we say the integral diverges.
In some cases, we take what is called the "Principal Value" which combines the two limits as
$$
\lim_{a\rightarrow 0^+}\left[\int_{-1}^{-a}\frac{1}{x}dx+\int_a^1\frac{1}{x}\right]=\lim_{a\rightarrow 0^+}\left[(\ln(a)-\ln(1))+(\ln(1)-\ln(a))\right]=0.
$$
Even though this limit exists, only the principal value exists (because the principal value cancels the equal infinities), the original integral itself does not exist.