To be able to breathe in space, you will need a set of oxygen gear. It can be equipped in the Galacticraft tab of your character screen. A full set includes one Oxygen Mask, one Oxygen Gear, and at least two Oxygen Tanks of whichever size you prefer. (You will not be able to make the Large Oxygen Tanks before travelling to Mars, as they require Tungsten and Desh).
To produce Oxygen you need an Oxygen Compressor and at least one Oxygen Collector. Connect them with Oxygen Pipes and hook them up to your preferred source of power. Place an Oxygen Tank in the Compressor to fill it with Oxygen.
An alternate way to get breathable oxygen without the previously mentioned machines can be done by making Liquid Oxygen in a Vacuum Freezer multiblock. It is a two-step process and somewhat tricky to find in NEI. First you must fill the fluid storage of an MV or higher voltage Assembling Machine with 16,000L of Oxygen. Place an empty Universal Fluid Cell (note that GregTech cells will not work in this recipe) and a Programmed Circuit configured to 16 into the machine, and you will get a cell of Compressed Oxygen. Now place this cell into your Vacuum Freezer to receive a Liquid Oxygen cell.
Now you can extract the Liquid Oxygen into an Empty Canister using a Fluid Canning Machine. To fill your Oxygen Tanks, simply place one tank into a crafting grid along with your Filled Canister of Liquid Oxygen, and it will automatically fill the tank. From the 1000L (mB) in your Canister, the Small tank will take 83L, the Medium tank will take 166L, and the Large tank will take 250L. A full Canister will last about 80 minutes. Keep an eye on the tank gauge at the upper left of your screen. If at any point your tanks run completely out of oxygen, you will take damage and die very quickly.
You can also gather oxygen using your Collectors while in space. Place some plants or crops near the machine to supply it with oxygen. If you want a place to breathe without your oxygen gear, you can make an enclosed room using an Air Lock as a door.