Understanding a circuit containing PMOS and NMOS
inverting amplifier

To understand what is happening it is better not to apply a static voltage to \$V_{\text{in}}\$ but instead a Sinus

Think about what is happening while the Voltage is rising from 0V to peak 
(The n-Mosfet is "opening" as the voltage is rising and so your \$V_{\text{out}}\$ is getting more "Negative)

And than again what is happening while the Voltage is falling
(Now the p-Mosfet is doing the same thing as previously the n-Mosfet and   the n-Mosfet is now "blocking" the negative Voltage)