Switzerland is one of the countries where public transportation in general and the train specifically are very well developed. The Fribourg train station is located in the middle of the town and serves also as the hub for an extensive local bus lines..
Fribourg is itself in the middle on the main Swiss train line that links Zurich with Geneva. The travel time is around 1h30 from each town with one train every half hour that will connect you with these main cities and those in the middle like Bern or Lausanne. Internationally, Fribourg can be reach by train in 4h30 from Paris, 4h from Milan and 4h30 from Frankfurt with only one change of train.
Swiss train web site and timetable: http://www.sbb.ch/
An extensive network of local trains is also available that will link Fribourg with Murten/Morat or Estavayer in the west; Romont, Bulle and Gruyere in the south; Bern and Thun on the north. It also possible from Fribourg to reach in Montbovon the famous Golden Pass train that join Montreux and Interlaken. Places that cannot be reached by train are often served by bus.
Canton Fribourg Transports web site http://www.tpf.ch/