Public Transport, Hamburg
Generally, the U and S-bahn is very safe. But as you would in any city, be aware of late night drunks, especially on the weekends, especially on days where one of Hamburg's football teams has been playing. I was told it's not so much the locals you need to watch out for, it's the visitors.
By four o'clock in the morning Sandy, Stu and I were ready for sleep...We got a cab back to the airport pulled out a sleeping bag and the three of us snuggled in.
Since it was so cold out we needed to stay together to keep warm....I got some sleep (I don't know how it was possible...)
Please don't resort to this, book your accomodation and train times early.