Generally, when writing a paper, one should underline the title of a book. Depending on the writing style you are working with, you may have other options.
When writing a paper according to the Modern Language Association standards, book titles should be italicized. If you hand-write drafts of your paper, underlining is appropriate.
If you format your paper according to the American Psychological Association style guide, you may either underline or italicize the title of a book.
MLA and APA are the most commonly used style guides in academics in the United States, so unless you are from another part of the world or working in a very niche academic subject, I think it is unlikely that you would use a different style. If your teacher hasn't specified their preferred format, italics or underlining are most likely appropriate-- just be sure to be consistent in how you use either throughout your paper.