In Se7en, John Doe is tracked to his residence by Detectives Mills and Somerset due to activity on his library card:

"Divine Comedy", "History of Catholicism", A book called "Murderers
and Madmen", "Modern Homicide Investigation", "In Cold Blood", "Of
Human Bondage". The Marquis de Sade. Works of Saint Thomas Aquinas.
There. He wrote about the seven deadly sins.

These are the books that John Doe had checked out. John Doe was shown to be extremely knowledgeable in the Seven Deadly sins. He obviously had been studying them for quite some time to the point of obsession.

Also, we see that John Doe's apartment is stocked with several books.

I understand that the notebooks to the left of Somerset are John Doe's personal writings. However, there are several books shown in his apartment.

The police officer even states how well educated and wealthy he is.

All we know about him is that he's independently wealthy, well
educated and totally insane.

Is it ever explained why John Doe would need to check out books from a public library on a subject that he is obviously already well versed in?

2 Answers
2

It is not explained, but we can theorize.

We don't know when he rented those books. He might have done so before buying his own (to ensure he indeed should buy them), or because the books weren't easy (or cheap) to purchase.

Also remember that instead of renting books on a subject he is well versed in, he probably became well versed on the subject thanks to renting those books.

Finally, despite those books in his apartment, IIRC we are never told what those books are about. They might have had nothing to do with the seven deadly sins (John Doe wanted to avoid having incriminating evidence on his home, perhaps?), and thus all of his knowledge came from renting the books in the library. The books in his house might have been educational on a ton of other subjects or philosophies.

Also keep in mind, the Internet still wasn't a thing back then. And books such as the ones mentioned (on bondage, homicide, or by Italian Dominican friars) might have not been easily found in your regular old book store.

Finally, you can also claim that he rented them to make the plot move along, as this was their main lead.

It is easy to forget in the age of Amazon that libraries used to be the easiest and sometimes the only way to get certain books. given the context and era of the setting this is far from just a plot device.
– matt_blackJul 23 '17 at 9:52

This is how I saw it (maybe incorrectly) within the movie and more of a personal theory: John Doe borrows the books from the library to leave a clue in order to get caught.

It is a popular misbelief that serial killers want to get caught (they don't, as explained here and here). But in the case of John Doe it is a reality. He isn't a regular serial killer, he is an "artist." He sees his crimes as a "masterpiece" in which he is not only the author but also part of the artwork... and to play his part, eventually he needs to "get caught".

Doe is incredibly smart and manipulative. Everything he does has a purpose, he has been planning/committing his crimes for a long time and he never intends to go to jail, but he needs to get close to the investigators in order to find their background and complete the circle of sins.

Mills and Somerset are always a few steps behind. They see the library booklist as a mistake that put them in the lead, but Doe was expecting it all along. Maybe not as soon as it happens, but it was always part of his plan. And Mills is the perfect puzzle piece that he is missing.

And that's why I think that the list of borrowed library books is just a clue left behind on purpose. He is smart to know that it can be tracked, and he lives in a big city and has enough resources to get those books from different sources (libraries, bookstores, antique stores, universities...) without a trace that would connect them to him.

...although that's just a theory, and you could say that Doe made a beginner's mistake at the library and that he was just improvising at the end. But seeing him as a cold-blooded all-calculated crime mastermind makes the character (and the movie) darker and scarier.

I really like this answer because I do believe that John had everything planned out. When the detectives go to John's house and knock on his door John arrives home and is surprised to see them there. I would think that John would've anticipated their arrival at some point if he left the library books as a trail to him.
– slaphshot33324Dec 18 '18 at 15:19