How to derive the relation between gibbs energy and equilibrium constant?
Firstly, if you know the relation $G= H-TS$, you can reach at the differential form of it just by taking differential at both sides, i.e.$$dG= dH-SdT-TdS$$ Now, recall the definition of enthalpy as $H= U +PV$, So, we can write, $dH= dU + PdV + VdP $, and also recall the heat supplied to the system as $dQ= TdS $ and by the first law of Thermodynamics, $dQ= dU+ PdV$ .Thus combining we have $$dG= dU+PdV+VdP-SdT-dQ = VdP -SdT$$ Thus you derive the required relationship.


Now coming to your next question, it's not about taking path where Entropy and volume remains constant. A state in a thermodynamic system can be defined in terms of three parametrs which are interrelated i.e Pressure, Temperature and Volume. In fact, you can only independently vary any two out of these three parameters and third one will automatically get adjusted. Here the independent variables are Temperature and Pressure. By changing the Pressure and Temperature independently, the change in the Gibbs' Free Energy is calculated. The coefficients are volume and Entropy only but that doesn't mean they are kept constant. So, the interpretation of the equation $dG= VdP- SdT$ needs to be done correctly.