First, we consider:
74.0%, 8.7% and 17.3% for 100g of the compound.
So there are 74.0 g of C
8.7 g of H
17.3 g of N
Now it is necessary to pass these values to the amount of matter (mol). We do this by dividing each of the values found by their respective molar masses:
C 74.0/12 = 6.17
H 8.7/1 = 8.7
N 17.3/14 = 1.24
Now we can divide each element by the smallest number (1.24):
C 6.17/1.24 = 5
H 8.7/1.24 = 7
N = 1.24/.124 = 1
So the empirical formula of Nicotine is C5H7N.