the frequency cannot change, as it depends on the source. now, imagine light as a particle, when it's going through glass, which is a denser medium than air, is more tightly packed with particles than air is. think of it this way, will you walk faster in a crowd or on an empty street? going through the empty street (air) there are lesser objects to bump into so what do you think will happen to the speed now?