It's actually important to recall that this is true only by definition, because it's part and parcel of what refraction means. But refraction is not the only thing that can happen when light passes between two mediums, even though it is probably by far the most common thing that happens in this situation.
There are solutions of Maxwell's equations where light passes between two mediums and the interaction of electromagnetic field and medium is linear, and, experimentally, we observe these interactions often and in keeping with Maxwellian theory. In such a case, the physics is as described by John Rennie's Answer.
But intense beams incident on a frequency doubling or other nonlinear material, where the physics is no longer linear, do not conserve the frequency. Hence my somewhat pedantic point about being true by definition. One can't prove that frequency is conserved in general, as shown by the nonlinear counterexamples.