RWT,
Your best bet is a direct train from Rome to La Spezia. Travel time is about four hours (reservations compulsory). From La Spezia you'll transfer to the smaller "local" train for travel to whichever of the five Cinque Terre villages you'll be visiting.
If you go "through Pisa to Riomaggiore", you WILL have to go through La Spezia. If Riomaggiore is your final destination, the travel time from La Spezia is only about eight minutes so be ready to disembark (even if your train car appears to be in a tunnel)!
When you buy your ticket in Rome, be sure to specify your final destination so that you don't have to buy another ticket in La Spezia.
Happy travels!