Chemistry - What is the correct expression of pressure-volume work?
At the inside piston face, the pressure exerted by the gas on the piston is equal to the pressure exerted by the piston on the gas. This just follows from Newton's 3rd law of motion. But, in an irreversible process, the pressure exerted by the gas on the piston face cannot be obtained from the ideal gas equation (or other real-gas equation of state). This is because the equation of state applies only at thermodynamic equilibrium. Otherwise, the gas pressure on the piston involves viscous stresses which depend not only on the volume but also on the rate of change of gas volume. For a reversible process, the gas pressure throughout the gas, including at the inside piston face can be determined using the equation of state, since a reversible process consists of a continuous sequence of thermodynamic equilibrium states.
In using these work relationships, it is important to specify what you are calling the system. If the system includes only the gas, and the piston is massless and frictionless, the pressure on the outside piston face is equal to the pressure on the inside piston face (and the gas pressure). If the piston is included as part of the system, and the piston is not massless or frictionless, then the external pressure is the pressure on the outside piston face, but this is not equal to the gas pressure on the inside piston face (or, equivalently, the piston pressure on the gas).