Many locals use bikes to get around but unless you are a good rider, it may be safer to walk. The roads are congested, especially around TET. It is a fairly compact city so easily explored on foot.
We arrived via plane from Vientiane, Laos for an extortionate $108 PLUS a $10 departure tax! The alternative is an excruciating bus trip, make your choice.
We left via the Reunification Express Train to Hue. This was an overnight train that left at 11 at night. We got a soft sleeper for some luxury. From what the ticket says, it cost 331,000 dong ($21) but our hotel charged us $29. We felt stupid until our sleeper mates for the night told us they paid $58 each! Buyer beware (hint: buy your own tickets at the train station).
As with much of Southeast Asia, most everyone gets around Hanoi on bicycles or motos. You can rent a bicycle for around $1 dollar a day. Motos rent for around $7-$8 dollars a day. I personally don't know how to ride a moto, nor would I risk the chaotic traffic of Hanoi's streets (see Lao moto accident). Instead, I prefer to hire a moto driver to get me where I'm going. Make sure you negotiate the price before you go. They'll usually quote you three times higher than the actual price. What else is new, right? You can also go for a relaxing cyclo ride. Same rules apply as with the moto drivers.
You can rent a bicycle for about less than 1USD to explore the city. Its much easier and you get to experience first hand on being on the streets with the locals. Hanoi is a relatively flat terrain, so cycling is relatively effortless.