Yeah I know that refractive index is different for different monohromatic lights due to the change in velocity of light. And as frequency doesn't changes and only wavelength changes while travelling through any medium so we can say, by $v=f\lambda$ velocity must change. But the point is why does wavelength changes and frequency doesn't?
There seems to be two different question in one:
- Why refractive index of some materials is dependent on frequency?
- why when a wave enters a material, its wavelength changes, but not the frequency?
The first question refers to the phenomenon that is called dispersion, phase velocity and group velocity. This is a big and important topic for waves of any nature (not necessarily electromagnetic ones), which cannot be covered here, but which is discussed in many books.
The second question is easily answered: the boundary conditions at the surfaces where the wave enters the media require that the waves on both sides of the surface have the same time dependence, which for monochromatic light means the same frequency. Since the phase velocity inside the material is different from that in vacuum, the wavelength has to be different.
The different phase velocity itself arises from the fact that the field inside the material is a combination of the field of the incident wave and the fields (polarization and magnetization) induced inside the material. Since these polarization and magnetization fields are not induced instanteneously, the phase velocity depends on how fast the field changes, that is on its frequency. In many situatiosn however this dependence can be neglected, hence the characterisation of materials by constant permittivity, permeability, and refraction index ($\epsilon, \mu$, and $n$).