Does the title of an essay have to be a question to which the essay itself is an answer?

No. Essays can have all kinds of titles. That is just one possibility. But if you have an assignment that says to do it this way, then that's your assignment.