State functions such as $G$ only depend on the state of the system and are not dependent on the "path" that took the system to that state (which would be the case for work, for example, which is not a state function.
We know that:
$$\mathrm{d}G=V\mathrm{d}p-S\mathrm{d}T$$
So…
$$\mathrm{d}G=\left(\frac{\partial G}{\partial p}\right)_T\mathrm{d}p+\left(\frac{\partial G}{\partial T}\right)_p\mathrm{d}T$$ Consequently, by comparing coefficients:
$$V=\left(\frac{\partial G}{\partial p}\right)_T$$ and $$-S=\left(\frac{\partial G}{\partial T}\right)$$
Just taking the equation involving $V$ now to save time and space: $$\int_{p_1}^{p_2}V\mathrm{d}p=\int_{p_1}^{p_2}\left(\frac{\partial G}{\partial p}\right)_T\mathrm{d}p$$
Using the perfect gas equation and integrating leaves the result:
$$G(p_2)-G(p_1)=n\mathcal{R}T\ln\left(\frac{p_2}{p_1}\right)$$
But if $G$ is independent of the path taken to get to the final state, why shouldn't I use the equation
$$\Delta G=V(p_2-p_1)?$$