Yet another way to get at it: if $\int \frac{dx}{x}$ were rational, we could write
$\displaystyle \int \dfrac{dx}{x} = \dfrac{p(x)}{q(x)}, \tag 1$
with $p(x), q(x) \in \Bbb R[x]$.
First question: how do we know we can take $p(x), q(x) \in \Bbb R[x]$, and not $p(x), q(x) \in \Bbb C[x]$? Well, if $p(x), q(x) \in \Bbb C[x]$, we could write
$\dfrac{p(x)}{q(x)} = \dfrac{\bar q(x) p(x)}{\bar q(x) q(x)}, \tag 2$
with
$\bar q(x) q(x) \in \Bbb R[x]$. We then see that
$\Im(\bar q(x) p(x)) = 0, \tag 3$
since $\int \frac{dx}{x}$ is real. Thus
$\dfrac{p(x)}{q(x)} = \dfrac{\Re(\bar q(x) p(x))}{\bar q(x) q(x)}, \tag 4$
the quotient of two real polynomials; so we might as well assume that
$p(x), q(x) \in \Bbb R[x] \tag 5$
from the beginning.
We can differentiate (1) and obtain
$\dfrac{1}{x} = \dfrac{p'(x)q(x) - p(x)q'(x)}{q^2(x)}, \tag 6$
which we may re-write as
$q^2(x) = x(p'(x)q(x) - p(x)q'(x)). \tag 7$
Now it is easy to see that
$\deg(p'(x)q(x) - p(x)q'(x)) = \deg p(x) + \deg q(x) - 1, \tag 8$
and so
$\deg x(p'(x)q(x) - p(x)q'(x)) = \deg p(x) + \deg q(x); \tag 9$
also,
$\deg q^2(x) = 2 \deg 2q(x), \tag{10}$
so we find
$2\deg q(x) = \deg p(x) + \deg q(x), \tag{11}$
whence
$\deg q(x) = \deg p(x). \tag{12}$
Now say
$p(x) =\sum_0^n p_i x^i, \tag{13}$
and
$q(x) = \sum_0^n q_i x^i; \tag{14}$
then
$\dfrac{p(x)}{q(x)} = \dfrac{\sum_0^n p_i x^i}{\sum_0^n q_i x^i} = \dfrac{x^n\sum_0^n p_i x^{i - n}}{x^n\sum_0^n q_i x^{i - n}} = \dfrac{\sum_0^n p_i x^{i - n}}{\sum_0^n q_i x^{i - n}}, \tag{15}$
whence
$\lim_{x \to \infty}\dfrac{p(x)}{q(x)} = \lim_{x \to \infty} \dfrac{\sum_0^n p_i x^{i - n}}{\sum_0^n q_i x^{i - n}} = \dfrac{p_n}{q_n} < \infty; \tag{16}$
but this contradicts
$\lim_{x \to \infty}\displaystyle \int \dfrac{dx}{x} = \lim_{x \to \infty} \ln x = \infty; \tag{17}$
thus (1) is impossible.