In Austria there are two train companies: ÖBB and Westbahn. The first one is the most important one and connects all the main cities and most of the villages. Westbahn offers one line from Salzburg to Vienna (westbahnhof) and one fro Salzburg to Vienna (Hauptbahnhof). The most interesting thing about the second line is the fact that if you arrive by plane to Vienna and want to come to LInz you will not have to change the train but come directly.
You can see the routes here.
The cheapest way to travel with the ÖBB is to get a discount card. On the contrary, you don´t need any extra card to save money while travelling with Westbahn. This company offers a wide range of discounts. I will explain some of the most convenient. Do not forget to check them on the webseite in case the change.
It´s a kind of last minute ticket. You can choose the route, the date (only two days in advance) and that´s all. You get a ticket for 8€. The problem is that you can not choose the time. In fact you will get an email with your timetable. This option is very cheap but not so flexible. If you have an appointment or you have to be at a certain time this will probably not be a good option for you.
This is a short ride ticket (for example Linz-Attnang or Linz-Amstetten). Depending of the route you will pay between 4,99€ and 7,99 €. If you want to visit the Salzkammergut Lake area you can buy a ticket to Attnang Puchheim and then buy a Einfach-Raus-Ticket
This is similar to the WEST-Chance because you can only choose the time. Depending on the route you can pay 8€ ( Linz-Vienna) , 13€ (Vienna- Attnang) or 18€ (Salzburg-Vienna). You can buy the tickets only two days in advance and there is a limited amount of tickets on sale you have to be fast. E
If you are a student and have an Austrian university card you get 10% discount only from Monday to Thursday and Saturday (the whole day). If you are traveling on a Friday or a Sunday you get the discount if you travel before 12 p.m.
Westbahn does not have selling spots that means you can buy the tickets either online or directly on the train. If you want to get one of offers mentioned your only option is online since you will have to pay the whole price on the train.
I hope this information has been useful. If you have any doubts please write a comment below.