Is your overnight trip from Rome to Naples on the train? Surprise! The night train to Naples from Rome is merely an late evening train and not an overnighter. It makes the trip in 2.0hrs. just like the day trains. It's like going from Seattle to the Canadian border on I-5.
The only way you can buy tickets here for Italy is to use a ticket broker. These tickets are more expensive than in Italy. You'll get the best price possible by buying at the train station. If you are days early for your trip, you might even get the discounted, but limited, AMICA 20% off. You can't do that from here.
Last, to get to Pompei, you need to transfer to the Circumvesuviana train in the Naples train station. It's a different train system. Just go downstairs after you get off of the Trenitalia train. No advance tickets on this train. Get off at the Scavi stop.