The "Temple of Literature" is basically a Confucius temple like you find all over China and the Buddhist world, except not quite as attractive as many of the others. So, if you've been to Confucius temples elsewhere, you don't need to go out of your way to see this one. However, if you haven't seen them, then this is a nice stop on your city tour of Hanoi. Take a guide with you to explain about it, or at least buy the brochure, as there isn't much information inside to help you understand what you're seeing.
It was partially destroyed in the war, but rebuilt, and parts of the temple date back about 1,000 years. There are statues of Confucius and Vietnamese kings, where local people come to pray and students pray to Confucius before their exams. However, this type of temple is not as important anymore in Vietnamese culture as it is in Chinese culture. It won't take you very long to visit here, about a half hour is probably enough, but if you have a guide to tell you about it, and you haven't "been there, done that" yet, then this is definitely worth your time to stop by for a visit. Perhaps the nicest part is that it's like an oasis in the middle of the city - you step inside the walls and barely hear the honking and motorbike engines from the streets around.