More clearly, in a dispersive medium like a prism, the wavelength of the light depends on its frequency.
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.
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.