Seismic waves traveling through the earth refract for the same reason that light refracts when entering different substances (e.g. air, water). The inner corehas a different density from the outer core, and this difference in density tells us that it is solid.
Hope this helped. Good luck!