Some of the above information while accurate may be a little confusing. First, use the national rail site to book trains within that country. While you can look on dbahn for all schedules, you can only purchase tickets on bahn for trains beginning or ending in Germany. All train travel in Italy should be purchased at trenitalita. Three levels of tickets in Italy - Super economy, economy, and base fate. The availability of super economy and economy vary by train, date, time. S economy are absolutely no change, no refund. Economy is changeable for a fee. The number of SE and E tickets are controlled and sell out early. Never buy a regional ticket on line unless it happens to be part of an extended trip. Regionale train tickets never sell out. And, very important, these tickets must be validated (time stamped) in a yellow or blue machine near the terminal or tracks.
Watch the train schedule. Although lots of trains go between Rome and Venice, they do not all follow the same route.
You cannot buy at ticket until the schedule is available. Schedule actually change very little from one quarter to another. Often it is a matter of only a few minutes.