MathML is "an XML-based language for describing mathematical notation". It was developed because mathematical notation requires more than a single line of typographic symbols, and is therefore difficult to represent in just text.
In contrast, chemical formulae are always "limited to a single typographic line of symbols, which may include subscripts and superscripts."
Because MathML is for math (not chemistry) and a chemical formula never needs more than a single line of text, it would be more semantic to use the <sup>
(Superscript) and <sub>
(Subscript) elements that are native to HTML.
<p>Plants require CO<sub>2</sub> for photosynthesis.</p>
You could also consider combining this with an <abbr>
abbreviation element if you need to semantically note the name of a chemical.
<p>Plants require <abbr title="carbon dioxide">CO<sub>2</sub></abbr> for photosynthesis.</p>
You could also consider using an <i>
Idiomatic Text to offset chemical equations from other text. This element is used to represent "a range of text that is set off from the normal text for some reason, such as idiomatic text, technical terms, taxonomical designations, among others."
<p>Hydrogen and oxygen can combine to form water: <i>2H<sub>2</sub> + O<sub>2</sub> → 2H<sub>2</sub>O</i></p>