Most of the time the Bahn is not the cheapest choice, but it has some interesting offers. There are some special offers for every federal state and there exists also a ticket which is valid for whole Germany. You can travel together with up to 5 friends. The more you are the cheaper it gets. Just be careful, because you are only allowed to use the local traffic ( no ICE and IC). So it takes you a bit longer.
This option is perfect if you want to make a trip to the sea or for exampel to Lübeck ( you only need the Schleswig-Holstein ticket)
There are different companies who offer intercity bus tickets. If you book early enough it is really cheap (Only 9 € from Hamburg to Mannheim for example) The different companies are Flixbus, MeinFernBus or Eurolines