I don't understand your notation
$$\int_{\text{path one}}^{\text{path two}}$$
You meant to split the square path into its edges, right? In this case you cannot apply Goursat, the region over which the function $f$ is holomorphic is not simply connected (it has one hole at $0$), hence the two integrals can be non-zero.
I don't have the book at hand, but I think it is saying the following.
Call $R_1, R_2$ the two squares (paths). Assume that they their corresponding edges parallel, and assume that $R_1$ is inside $R_2$. Split the in-between region into four trapezoids (or eight triangles if you wish), and call their contours $T_1, \ldots, T_4$. Note that
$$\int_{R_2} = \int_{R_1} + \int_{T_1} + \int_{T_2} + \int_{T_3} + \int_{T_4}.$$
You can check that this is true since some paths on the right hand side cancel out (one time you integrate one direction, one time the opposite). Probably a drawing would explain better. Then by Goursat the integrals along the paths $T_i$ are zero, since they are contained in a region over which $f$ is holomorphic.
From this two facts you get proposition (1)
$$\int_{R_2} f \, dz= \int_{R_1} f \, dz.$$
For an example, try to compute the integral of $f(z) = 1/z$ along a square path of arbitrary edge length. You should get $2 \pi i$, which is the same result you get if you integrate it along a circle or arbitrary radious with the same orientation (in fact, if two paths are homotopic, or two closed paths are free homotopic, then the integral along a path is equal to the integral along the other).
Edit. I just saw your comment to the OP. Yes, you could apply the residue theorem, in which case the two integrals are just the residue at the origin, but I belive your book prove the residue theorem after this proposition.
Best Answer
Since we are concerned about large $x$, we assume $x>1$ at the beginning. To proceed, consider introducing a parameter
$$ f(a)={1\over2\pi i}\oint_\Gamma{x^s\over s}\log{1\over s/a-1}\mathrm ds $$
where $\Gamma$ rotates around $s=a$.
so all we need is to find $f(1)$. To proceed, we differentiate on both side to get
$$ f'(a)={1\over2\pi i}\oint_\Gamma{x^s\over s}\left[\frac1a+{1\over s-a}\right]\mathrm ds={x^a\over a} $$
In order to proceed, we consider integrating through the straight path connecting $a=-\infty$ and $a=1+\delta i$ (with $\delta\in\mathbb R$). This means we have
$$ f(1+i\delta)=\int_{-\infty}^{1+\delta i}{x^a\over a}\mathrm da=\int_{-\infty}^{(1+\delta i)\log x}{e^t\over t}\mathrm dt $$
Now, we deform the path into horizontal segment from $-\infty$ to $-\delta$, an arc going through $-|\delta|$, $i\delta$, and $|\delta|$
$$ f(1+i\delta)=\int_{-\infty}^{-|\delta|}+\int_\delta^{(1+|\delta|i)\log x}{e^t\over t}\mathrm dt+\int_{-|\delta|}^{|\delta|}{e^t\over t}\mathrm dt $$
when $\delta>0$, we have
$$ \int_{-|\delta|}^{|\delta|}{e^t\over t}\mathrm dt=-i\pi $$
when $\delta<0$ the RHS changes sign. Consequently, we obtain $f(1)$ by calculating its Cauchy principal value:
$$ \begin{aligned} f(1) &\triangleq\lim_{\delta\to0^+}{f(1+i\delta)+f(1-i\delta)\over2} \\ &=\lim_{\delta\to0^+}\int_{-\infty}^{-\delta}+\int_\delta^{\log x}{e^t\over t}\mathrm dt \\ &=\lim_{\delta\to0^+}\int_0^{1-\delta}+\int_{1+\delta}^x{\mathrm dt\over\log t} \\ &=\operatorname{li}(x) \end{aligned} $$
Conclusively, we obtain the prime number theorem in the form of
$$ J(x)=\operatorname{li}(x)+\mathcal O\left(xe^{-c\log^{1/10}x}\right) $$