Please help me explain the overshoot and undershoot in CMOS inverter
As the input signal starts to rise from 0 V, the NMOS transistor in the inverter will turn on when it reaches a threshold voltage; as it rises further, eventually the PMOS transistor will turn off.

In the initial portion of the rise, the PMOS is still (fully) on, and the NMOS has not started to turn on. However, there is gate-drain capacitance in that device (and also in the PMOS). So, the input signal is capacitively coupled to the output. The PMOS tends to shunt some of that coupling to VDD, but isn't 100 % successful -- thus the overshoot.

Similarly, on falling edges, you see undershoot. 

Slower rising input edges will allow the 'ON' transistor to shunt more of the coupled signal to the rail, but it's never 100 % eliminated.