Exactly as the title asks.

Pure oxygen is generally represented as O2 yet oxygen is an element of the periodic table. Why is it O2 and not just O?