\begin{align}
\ln\left(\frac{1}{x}\right) & = \int_1^{\frac{1}{x}} \frac{1}{t}dt & & {\text{Replace $x$ by $\dfrac1x$ in the definition}}\\
u & = \frac{1}{t} & &{\text{This is the substitution you are making}}\\
du & = \frac{-1}{t^2}dt & &{\text{This is because }\dfrac{du}{dt} = - \dfrac1{t^2}}\\
\ln\left(\frac{1}{x}\right) & = \int_1^{\frac{1}{x}} \frac{1}{t}dt & = \int_1^{\frac{1}{x}} -t \times \left(-\frac{1}{t^2}dt \right) & \text{Multiply and divide the integrand by $-t$}
\end{align}
In the above integrand, we can replace $-\dfrac{1}{t^2}dt$ by $du$ and $-t$ by $- \dfrac1u$.
Note that we are making the change of variable, the integrand is in terms of $u$ now.
Hence, we need to look at the limits for the variable $u$ in the integral.
We have the transformation that $u = \dfrac1t$. Hence, if $t$ goes from $1$ to $1/x$, then $u$ goes from $1$ to $x$. This is because when $t=1$, $u = \dfrac11 = 1$. Similarly, if $t = 1/x$, then $u = \dfrac1{1/x} = x$.
(For example, if $t$ goes from $1$ to $2$, then $1/t$ goes from $1$ to $1/2$.)
Hence, we get that
\begin{align}
\ln \left( \dfrac1x\right) & = \int_1^{\frac{1}{x}} -t \times \left(-\frac{1}{t^2}dt \right) & = \int_1^x \left(-\dfrac1u \right) \times du = - \int_1^x \dfrac{du}{u} = - \ln(x)
\end{align}
where the last equality is obtained since we have defined $\ln(x)$ as $\displaystyle \int_1^x \dfrac{dt}{t}$.