First things first: there’s no direct train from Trondheim to Bergen. If you want to take a train, you have to go by way of Oslo. To get directly from Trondheim to Bergen without a car, you must fly, take a bus, or take the coastal steamer.
Flights in and out of Hammerfest are primarily by way of Tromsø. To get there from outside the country, you need to travel to Oslo, Bergen, or Trondheim, then fly to Tromsø, then finally to Hammerfest. On the way south again, following your itinerary, you would need to travel to Tromsø, then to Bodø - again, by airplane, bus, or boat, since there’s no train service. If you want to get north of Tromsø in a hurry, you almost always have to fly through Tromsø.
Actually if you have the budget for it, the coastal steamer is a hell of a trip, and as far as I know you can still arrange to hop off in different cities. (Once, it was basically a floating bus that served coastal towns and cities, and most passengers were locals. Now, the boats have been upgraded to floating hotel status and the passengers are mostly tourists, with a corresponding increase in price.) Hammerfest, Bodø, Trondheim, and Bergen are all among its stops, and you can take a train from Bergen to Oslo. Don’t take the overnight train on that route unless you have to! The trip is short - take the first train of the morning and you’ll arrive in early afternoon - and the scenery is spectacular.
Renting a car is of course an option, but be advised that distances are longer than you may think and roads are not great, particularly in the north. When we lived in Trondheim I would periodically meet tourists who were under the impression that they could start early in the morning, drive up to the North Cape, and be back at their Trondheim hotels by midnight :eek: In fact, it’s a two-day drive each way at a minimum, and then only if you take a route that wouldn’t be obvious to most tourists, through Sweden and Finland.
Avinor, the Norwegian civil aviation authority, has an English-language site (follow the link) that lists the airports with scheduled flights. Click on them and you’ll find a schedule of arrivals that will give you some idea how the different airports link up. That’s the best I’ve found so far…