Hello!
The general chemical reaction for the combustion of a fossil fuel is the following one:
C(s) + O₂(g) → CO₂(g)
Now, we use the following conversion factor to go from kilograms of CO₂ to kilograms of O₂, using the molar masses of each compound and the reaction coefficients:

So, for producing 5*10¹² kg of CO₂,
3,64*10¹² kg of O₂ are required.
Have a nice day!