We know that , Oxygen is diatomic
n=mass of sub ÷Molar mass of sub
& Here given 5 gram O2 molecules not atoms
So n= 5÷32=0.1562 moles O2
TotaO2=0.1562×6.022×10^23 O2molecules
TotalO2=0.9409×10^23 O2 molecules
Now one Oxygen molecule correspond to two Oxygen atoms
So no of oxygen atoms(X)
X=2×0.9409×10^23 oxygen atoms
X= 1.881×10^23 Oxygen atoms
Hence 5 gram oxygen containing 1.881×10^23 Oxygen atoms