And remember, the "speed of light in the medium" depends on the wavelength of the light. This is why prisms separate light by color.
Because the speed of light (in the sense of phase velocity) is the product of wavelength with frequency, both the speed and the wavelength vary with frequency, thus also the refractive index varies with frequency.