When typing, book titles—in fact, the titles of any full-length works—should always be italicized. Titles of shorter works, such as a poem or short story, should be put in quotation marks. You should only underline the titles of full-length works if your essay is handwritten (as italics aren’t an option).
Book titles are italicized. If you are using a typewriter and can't write in italics, then it is customary to underline the title. Same applies to plays. Titles of poems, short stories, essays, and other short pieces are set off in double quotes. George Orwell's "Shooting an Elephant" would be in quotes, since it is only an essay. Commas and periods go inside the closing quotation mark, as for example with Orwell's "Shooting an Elephant." The English do it differently and this can create some confusion, but observe the usage in American publications.