I wanted to know why the frequency of a wave does not change even on reflection or transmission and does it only depends on the source only.
Frequency depends only on the source of the wave. Whatever is generating a given wave is going through some type of harmonic motion, and that motion generates a disturbance in some medium (for mechanical waves). The wave may encounter a denser medium in its travels, in which case it will slow down and its wavelength will get shorter. Despite that, the frequency will remain constant, and given that two out of three from the list of frequency, velocity, and wavelength are known, the unknown variable may be calculated from the equation $v=f\lambda$.
In the case of reflection or transmission through simple linear dielectrics here is roughly what happens. Electric fields from the incident light travelling mostly in the $+z$ direction create drive oscillating dipoles in the dielectric. These dipoles create their own electric fields which add to the incident field as reflected and/or transmitted fields. Your question is why the new fields are at the same frequency as the incident field.
The reason the new fields are at the same frequency as the driving field is because the new fields come from the oscillating dipoles which are oscillating at the frequency of the incident field. The question is then why the dipoles oscillate at the frequency of the incident field. The answer is that the definition of a linear dielectric is that the dipoles oscillate at the same frequency as the incident field.
So the short answer to your question is essentially that, by definition, when we consider linear dielectrics the assumption of linearity implies that the transmitted and reflected fields will be at the same frequency as the incident fields.
This of course raises the question of non-linear dielectrics or media. I make a comparison to a non-linear harmonic oscillator. If you drive an oscillator sinusoidally with small amplitude at frequency $\omega$ you will find that it responds sinusoidally frequency $\omega$. However, if you drive it very hard you will see it now starts to respond a little bit non-sinusoidally - higher harmonics are introduced into the motion. A Fourier decomposition of the resultant motion would reveal motion at $2 \omega$ and $3\omega$. We say the oscillator is exhibiting non-linearity. It is the same with the light field. For certain non-linear materials a light field at frequency $\omega$ can induce dipoles which oscillate slightly non-sinusoidally meaning higher harmonics are exhibited. As a result you can have a material where you send in red or infrared light and some green light is generated!
This is the field of nonlinear optics