Why isn't $\lim_{n \to \infty} \int_{1/n}^{1} \frac{1}{x}dx$ equivalent to itself rewritten as a Riemann sum? I was comparing integrals to their equivalent riemann sums, specifically the harmonic series and I derived that:
$$\displaystyle{\lim_{n \to \infty}} \int_{1/n}^{1} \frac{1}{x}dx = \displaystyle{\lim_{n \to \infty}}\sum_{k=1}^{n} \frac{1}{k}$$
The issue is that they are not equal and I don't know why. I found when I plugged in large numbers for n into the above expressions, the difference between $\int_{1/n}^{1} \frac{1}{x}dx$ and $\sum_{k=1}^{n} \frac{1}{k}$ approached, gamma, the Euler Mascheroni.  I rewrote my equation to accomodate for the discrepancy:
$$\gamma +\displaystyle{\lim_{n \to \infty}} \int_{1/n}^{1} \frac{1}{x}dx = \displaystyle{\lim_{n \to \infty}}\sum_{k=1}^{n} \frac{1}{k}$$
And when I further simplified I found the main identity of gamma:
$$\gamma=\lim_{n \to \infty} \left ( -\ln(n)- \sum_{k=1}^{n} \frac{1}{k} \right ) $$
How could I have possibly known that there would be a constant difference between the two expressions without entering large numbers into my calculator?  And what error did I make in my initial derivation?
IIRC, the first term of all summations are equal to the integral of the function within the sum.  You can find the other terms of the sum by subtracting that integral from the sum.
Under your assumption:
$$\sum_{k=1}^{x} k = \frac{1}{2} x^{2}$$
This is incorrect and only an approximation of the function.
If you  calculate what function approximates
$$-\frac{1}{2} x^{2} +\sum_{k=1}^{x} k$$
You would find the second term of the function, $\frac{1}{2} x$
Why do you think they are not equal?
Everything indicates they are equal, the both regularize to $\gamma$.
Let's consider the transform $\mathcal{L}_t[t f(t)](x)$. It is notable by the fact that it preserves the area under the curve:
$$\int_0^\infty f(x)dx=\int_0^\infty \mathcal{L}_t[t f(t)](x) dx$$
But more interesting, it also works well with divergent integrals, allowing us to define the equivalence classes of divergent integrals. Particularly, by successfully applying this transform to $\int_1^\infty \frac1xdx=\int_0^\infty\frac{\theta (x-1)}{x}dx$, one can obtain the following equivalence class of divergent integrals (the first one and the third one turn out to be similar up to a shift):
$\int_0^\infty\frac{\theta (x-1)}{x}dx=\int_0^\infty\frac{e^{-x}}{x}dx=\int_0^\infty\frac{dx}{x+1}=\int_0^\infty\frac{e^x x \text{Ei}(-x)+1}{x}dx=\int_0^\infty\frac{x-\ln x-1}{(x-1)^2}dx$

On the other hand, applying the transform to $\int_0^1\frac1x dx=\int_0^\infty \frac{\theta (1-x)}{x}dx$ one can obtain another set of equal integrals:
$\int_0^\infty\frac{\theta (1-x)}{x}dx=\int_0^\infty\frac{1-e^{-x}}{x}dx=\int_0^\infty\frac{1}{x^2+x}dx=\int_0^\infty-e^x \text{Ei}(-x)dx=\int_0^\infty-\frac{x-x\ln x-1}{(x-1)^2 x}dx$

Now, having postulated equivalence of divergent integrals in each class, we can pick two integrals, one from each class and compare them. Well, it seems, the integrals in the second class are bigger by an Euler's constant:
$\int_0^{\infty } \left(\frac{1-e^{-x}}{x}-\frac{1}{x+1}\right) \, dx=\gamma$

And thus, we can conclude that $\int_0^1\frac1xdx=\gamma+\int_1^\infty \frac1xdx$. Surprising, is not it, given that one would naively expect $\ln 0=-\ln\infty$?
But we also have an identity $\gamma = \lim_{n\to\infty}\left(\sum_{k=1}^n \frac1{k}-\int_1^n\frac1t dt\right)$ and know the regularized value of harmonic series $\operatorname{reg}\sum_{k=1}^n \frac1{k}=\gamma$. Thus, we obtain
$$\int_0^1\frac1xdx=\gamma+\int_1^\infty\frac1xdx=\sum_{k=1}^\infty\frac1k.$$
So, your comparison technique is possibly wrong, but the integral is equal to the sum.