My book says: frequency is considered as the only REAL characteristics of electromagnetic radiation, because it is unchangeble if the radiation comes up with some other environment, while the wavelength and the wavelength number do change. How can wavelength change and the frequency not ? The formula tells us very clear that while frequency increases, wavelength decreases and vice versa ?!
Recall that frequency $f$, wavelength $\lambda$ and the speed $v$ of a wave are all related as follows $$ v = f \lambda \, . $$ So presumably, your book is talking about a situation when an electromagnetic wave crosses boundaries between different media. In such cases frequency indeed remains constant, while the speed of the wave, and consequently, its wavelength change.
Frequency of an electromagnetic wave is the characteristic of solely the source of the wave. A charge's frequency of oscillation would determine the frequency of the wave it produces. Refraction doesn't cause change in frequency, only wavelength, which results in a change in velocity as well.