Oxygen on Mars is proposed to be extracted from carbon dioxide
To bring astronauts back from Mars, the oxidizer needed for the return launch will have to be produced directly on the planet. At the Massachusetts Institute of Technology, researchers have developed a small plasma reactor for this purpose that splits carbon dioxide from the Martian atmosphere. That part of the process is already working well. The harder task is capturing the oxygen before it recombines with the other reaction products.
Source: universemagazine.com