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. Place an oxygen cell into your Vacuum Freezer to receive a Liquid Oxygen cell. Empty your liquid oxygen cell into a GT tank. An Ender IO tank is a great alternative, since you can fill it with liquid oxygen and break it to take with you to space.
Now you can put the Liquid Oxygen into an Empty Canister using the tank. 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.