Market equilibrium and pareto efficiency
A rough guideline:

You already know the first case. At $q &lt; q_c$ (competitive quantity), we have 

$$S(p) &gt; S(p_c) = D(p_c) &gt; D(p)$$

This is assuming you have "normal" (monotonic) assumptions on the supply and demand curves, which are pretty important to this proof. Notice that $S(p) = q_s; D(p) = q_d$ and in this case $q = q_s &lt; q_d$, that is, there is a shortage. At any higher price $p_0 \in (p, p_c]$, there is a Pareto improvement. A new seller will sell at this higher price and there will exist some buyer willing to still buy it.

The other case is analogous. At $q &gt; q_c$, now

$$D(p) &gt; D(p_c) = S(p_c) &gt; S(p)$$

You can use a similar argument as Varian's. At any lower price, there will be a buyer willing to buy the good and a seller still willing to supply the good.