The gravity of the earth pulls its air around it. Where there's space there's no air - it's all been pulled elsewhere (other planets and stars). The reason why air is not a solid or a liquid is that the molecules in the air don't attract each other enough to make them want to stick together in a puddle or as some solid mass - they're happy to go it alone. I can go in to more detail if you like =)
Air consists of the gases produced by the different kinds of chemical activity going on within and on the surface of the earth, these gases are retained by gravity...
an atmosphere, if you don't care about its composition, can indeed be of mineral origen, but the oxigen (in ours) it takes for life forms like ourselves to breathe, comes from the green parts of plants.
I guess it's a stupid question, because why is there melt? It just is. The earth was once covered in ice? And it warmed up...and the water needed an atmosphere, which requires plants? What the f happened?
When mummy and daddy get married and love each other very much, they hug each other in a special way.
I hope you're not insinuating that I said something dumb. It's a really good question. Albeit, pretty much unanswerable at the time being.
The question "Why is there air?" is unanswerable? I beg to differ. When the earth was formed it had no atmosphere at first. Atmosphere = air. It was a molten hot rock with atmospheric gases trapped in it. As the earth cooled, volcanoes brought these gases to the surface. More gases were 'donated' when comets hit the earth. Comets are made of water and gases. It was mostly carbon dioxide and water vapor at first, but when plants came along they started using the carbon dioxide and releasing oxygen, so now animals have oxygen to breathe.