Rules for the G:
The letter G before an O, A,U sounds like gota, gato, Gustavo(go, ganster, gustavo) and the letter G before I,E sounds like J. Therefore if you would like to sayseguir, without sounding like sejir, you have to add the U like a support to be able to pronounce as it correspond. Other example guitarra, if you don’t want to sound like jitarra, you have to add the U, to sound guitarra.
This is the reason why….
(SEG) is the Stem and (UIR) is the infinitive. Therefore since it always change the last vowel of the stem, in this case it changes the E for I, the E from the stem SEG.