Scientist predict that light moves 3x108 m/s in a vacuum. Then, when light hits a medium like air, it goes into a medium with a different index and travels slower (I believe it indexes at 1.007 in air). So my question is, how have scientists come to the conclusion that light travels as fast as it does in a vacuum, because can't we only observe it through a medium?
The very fact that light has finite speed was first discovered in astronomy. See for example the Wikipedia article on Aberration of light. Light which is responsible for this phenomenon travels in the empty space. By the way the difference of speed in the air and in vacuum is small, and the first precise measurement of this speed were made in the air.
To conclude from these measurements what is the speed in vacuum is easy by combining with an astronomical observation. Indeed, the difference of light speed in vacuum and in the air is responsible for the phenomenon which is called (astronomical) refraction. And refraction of the light coming from a star can be very exactly measured. If you know the speed of light in the atmosphere, you can compute the speed in vacuum. This is the general principle.