That depends on a few factors:
1) Price - if price is the main concern for you, we'd recommend going with the cheapest option. Rental prices can be a bit misleading because they have no value at the end of the rental. Used textbooks can be resold when you are done through your bookstore, our exchange or many other buyback programs. Consider the total cost of owning the book (purchase price - amount you'll sell it for) when buying - it'll make a difference.
2) Do you plan on keeping the book past the end of the term? Some students use their textbooks after their term has passed. If you plan on using the book for future use - definitely buy it. If not, renting is a great option.
3) Reselling the book. If you want to resell the book to other students or elsewhere, buy it. If you rent your book, you'll need to send it back to the place you rented it from without being able to sell it for cash at the end of the term.
4) Highlighting - surprisingly, this is a non-factor. If you like highlighting in books, you can either rent or buy. Rental providers almost always allow for modest amounts of highlighting, but check with the site you rent from to confirm this.