Why do we use diodes when we connect a 7414 IC?
Those are external protection diodes to protect the pins of 7414 IC. 

The upper diode clamps the voltage to Vcc + 0.7V, protecting the pin from much higher voltage than Vcc.

The lower diode clamps the voltage to Vcc - 0.7V, protecting the pin from voltages much lower than the ground.