The correct option is D O2
O2 is a molecule made up of 2 oxygen atoms. Therefore, it is an example of a molecule of an element.
However, NH3 contains 1 N and 3 H atoms, H2O contains 2 H and 1 O atom and CO2 contains 1 C and 2 O atoms. Therefore, they are considered as molecules of compounds.