Well, judging from your itinerary in most instance you can just buy self-printed tickets. Those are sold for Berlin-Prague (on
DB website), Prague-Vienna (
Czech Railways eShop) and Vienna-Budapest (
Austrian Railways), so you shouldn't experience any problems buying the above and printing it yourself.
Doing Budapest-Florence is a bit more complicated, since there is no direct trains and in general it will be more expensive, so as we see it, you have a few options:
a) simply fly using low-cost airlines. Such airlines won't get you directly to Florence, but somewhere not very far (like Pisa, Bologna, Rome or even Milan and Venice), from where you can get a relatively cheap train to Florence. Fare depends on date, but you can check companies like WizzAir or RyanAir and see if something looks good enough
b) as you already noted, use direct Vienna-Florence-Rome train for which you can buy ticket on mentioned above Austrian Railways website. Although, if you do decide to use it, then might be a better idea to change itinerary a bit and do Berlin-Prague-Budapest-Vienna, thus avoid traveling there and back between Vienna and Budapest, plus it will be cheaper, since one-way discounted tickets Prague-Vienna and Prague-Budapest cost the same (from 19 euro), while discounted one-way Budapest-Vienna (13 euro) bought from Hungarian Railways, which is cheaper than Vienna-Budapest
Are discount fares ever available at the train station without pre-booking?
In most cases yes, but the problem is that discounted tickets are sold in limited number per departure, so once you visit the station few days before you travel they are usually sold out, sometimes they get sold out even weeks before, thus buying in advance online isn't a matter of choice really, because it many cases it is the only way to catch cheaper tickets.