(N/A) Consider a cylinder which contains one mole of an ideal gas fitted with a frictionless piston. The total volume of the gas is $V_{i}$ and the pressure of the gas inside is $p$. If the external pressure is $p_{ex}$ which is greater than $p$.
The piston is moved inward until the pressure inside becomes equal to $p_{ex}$. Let the final volume be $V_{f}$. During this compression,suppose the piston moves a distance $l$,and the cross-sectional area of the piston is $A$.
Volume change $= l \times A = \Delta V = (V_{f} - V_{i}) \quad \ldots (I)$
Force on the piston $= p_{ex} \cdot A$
If $w$ is the work done on the system by the movement of the piston then,
$w = \text{force} \times \text{distance} = p_{ex} \cdot A \cdot l$
$= p_{ex} (-\Delta V) = -p_{ex} (V_{f} - V_{i})$