A molecule is a substance made up of atoms chemically bonded together, these do not have to be different. Cl2 (chlorine) is an element and a molecule, but not a compound because the atoms are the same. Examples of molecules include O2, H2O and CO2.
The atoms that make up a molecule can be of the same or different elements.
Molecules = any atoms