How can both of these equations for pressure be correct? Consider the Gibbs equation:
$$du=Tds-pdv$$
Identifying partial derivatives, one obtains:
$$-p=\left( \frac{\partial u}{\partial v} \right)_T$$
But you can also show that:
$$p=T\left( \frac{\partial s}{\partial v}\right)_T -\left( \frac{\partial u}{\partial v} \right)_T $$
In fact for an ideal gas, the latter partial derivative is $0$ and therefore it is the first term the one that determines its pressure. But how come both of these equations are true, at the same time?
 A: 
Consider the Gibbs equation:
$$du=Tds-pdv$$
Identifying partial derivatives, one obtains:
$$-p=\left( \frac{\partial u}{\partial v} \right)_T$$

No.
$$-p=\left( \frac{\partial u}{\partial v} \right)_s$$

But you can also show that:
$$p=T\left( \frac{\partial s}{\partial v}\right)_T -\left( \frac{\partial u}{\partial v} \right)_T $$
But how come both of these equations are true, at the same time?

Because you are using the wrong expression for $p$. You should use:
$$-p=\left( \frac{\partial u}{\partial v} \right)_s$$
You can then consider:
$$
T=\left( \frac{\partial u}{\partial s} \right)_v = T(s,v)
$$
to see that we can write $s = s(T,v)$. Then you can compute $\left( \frac{\partial u}{\partial v} \right)_T$ by considering the derivative of $u(s(T,v),v)$ with respect to $T$ at constant $v$.
A: Yes, both are true. Let consider this equation first, $$p=T\left( \frac{\partial S}{\partial V}\right)_T -\left( \frac{\partial U}{\partial V} \right)_T $$ For an ideal gas at constant temperature $\frac{\partial U}{\partial V}_T$ is not zero, but this is derived from constant gibbs energy thus it becomes zero.
Now, $\ T\frac{\partial S}{\partial V}_T=-\frac{\partial U}{\partial V}$. That is why both are correct. Although first term in it is, $\frac{-Nk}{V}=\frac{\partial S}{\partial V}$.
Reason: From first law,$$pdV=TdS-dU$$$$p=T\left(\frac{\partial S}{\partial V}\right)_T-\left(\frac{\partial U}{\partial V}\right)_T$$$$\text{Also,}\ \left (\frac{\partial U}{\partial V}\right)_T=kT\left(\frac{\partial N}{\partial V}\right)_T$$Now if, $dG=0=\mu dN$, then $\frac{\partial N}{\partial V}=0$
You can check it also, https://physics.stackexchange.com/a/736889/344834
