The reaction for the combustion of methane is given
CH4 + O2 →CO2 + H2O
CH4 + O2 →CO2 + 2H2O (balance hydrogen)
CH4 + 2O2 →CO2 + 2H2O (balance oxygen to balance equation)
Thus two moles of oxygen gas is needed to produce 1 mole of carbon dioxide gas.
Note that at STP, one mole of an ideal gas occupies 22.4L by Avogadro's law.
Thus 5.17liters of carbon dioxide at STP = 5.17/22.4 = 0.231 moles of carbon dioxide.
Twice as many moles of oxygen is needed so twice 0.231 = 0.462 moles of oxygen is needed
Thus the number of grams of oxygen needed is 2 times 16 times 0.462 = 14.8g = 14,800milligrams of O2.