Mars has long been a fascinating subject and Hollywood has tried to respond. In the 1950s, "The Angry Red Planet" depicted life on the red planet with scenes where the surface was entirely red and strange rat-spiders attacked the crew. "Robinson Crusoe on Mars" showed Mars as a desert-like planet with a thin atmosphere, and the hero survives there with an alien, human-like companion. We can forgive these movies as they used the famous astronomer Percival Lowell's descriptions of the surface of Mars and came out long before we ever sent a probe to Mars to see what it was like.
Mars is a cold desert planet where we think that water once flowed, and that water may still exist in frozen form at the poles and in the permafrost (for details, see How Mars Works). Two recent films, "The Red Planet" and "Mission to Mars," have a more realistic depiction of Mars based on the information gathered from Mars missions since 1976. However, in "The Red Planet," the astronauts crash on Mars and must walk a great distance across the surface to a habitat module. In the process, their space suits run out of oxygen; one crewmember commits suicide by jumping off a cliff rather than suffocate. In a dramatic scene, the remaining astronauts are suffocating in their suits, when one desperate astronaut opens the visor of his helmet and breathes. He miraculously discovers that Mars has oxygen. He tells remaining crew to do the same and they all survive by breathing the Martian air. Couldn't they have known that Mars had oxygen even prior to the crash?
Mars has a thin atmosphere composed mainly of carbon dioxide. At present, there is no oxygen to support humans. In addition, when heated or illuminated with light, elements and compounds absorb and radiate energy in various forms of electromagnetic radiation such as infrared. (See How Light Works for more information). The infrared spectrum is frequently used to determine what molecules exist in the atmosphere of a planet and how abundant they are. Earth-based telescopes equipped with infrared spectrometers can detect elements in the atmospheres of other planets and even planets around other stars. With these techniques, surely the astronauts in "The Red Planet" would have known that oxygen was present on Mars long before they even traveled there.
There has been research and proposals that it might be possible to terraform Mars in the future to make it more Earth-like (see How Mars Works). This has been the basis of Kim Stanley Robinson's sci-fi novels ("Red Mars," "Green Mars," "Blue Mars," "The Martians").