<p style="text-align: left;">Thank you for the question.</p>
For "1.258 grams per centimeters cubed (g/cm³)." I would enclose "1.258 grams" in one set of Nemeth switch indicators and "(g/cm³)" in another set of Nemeth switch indicators. That second chunk DOES include the parentheses.
For "grams (g) of 3 cm³ of the substance at room temperature." I would enclose only "cm³" in a set of Nemeth switch indicators.
I hope that helps! Please post here again if you are looking for further explanation.