The sky is blue because blue light is scattered far more than other colors. The light from the sun with shorter wavelengths is absorbed and radiated by the gas molecules in the sky. This is called "Rayleigh scattering."
Leonardo da Vinci was the first person to determine that the sky is blue because of the way air scatters light. He thought that the scattering was done by water vapor. It is actually done by the oxygen and nitrogen molecules. He is still the first one to understand and describe the phenomenon however. He wrote about it in his notebook in the 1500s.
More about Leonardo da Vinci: