The molecular weight of a given compound would simply the sum of the molar weights of each component.
The molar masses of the elements are:
C = 12 amu
H = 1 amu
N = 14 amu
O = 16 amu
where 1 amu = 1 g / mol
Since there are 6 C, 5 H, 1 N and 2 O, therefore the total molecular weight is:
molecular weight = 6 (12 amu) + 5 (1 amu) + 1 (14 amu) + 2 (16 amu)
molecular weight = 123 amu
Therefore the molecular weight of nitrobenzene is 123 amu or which is exactly equivalent to 123 g / mol.