Which books should every writer have? Whichever ones you want and whichever ones you find useful.
With that question in mind, here's a list of reference books I find useful when writing.
Foreign language dictionaries. I currently have German, French and Spanish and am planning to add several more to my collection, including Latin and Greek. I find it useful to be able to add a foreign phrase occasionally and though the internet can be useful in these matters, there's nothing like looking it up yourself and then checking you've got it right later. They're also useful if you want to create an alien word as they give you a good starting point.
Phrase origin books. Why do we say certain phrases and where did they originate? Some of the explanations can be a little weird, but I find Brewer's Dictionary of Phrase and Fable, A Word In Your Shell-Like and several smaller volumes useful. They can also be a starting point for a story idea.
Rhyming dictionary. No reason, I just like the idea of owning one. It has NOTHING to do with me being a frustrated song writer.
Writing guides. Good Writing Guides, Idiot's Guide to Grammar and several other volumes are always good for some correction and editing help.
Books on editing. If I need to explain this, you are NOT a writer.
Play/Film/TV scripts. Not only because I'm an amateur actor or because I write play scripts, but also as they are focused on dialogue. If dialogue is a problem for you, read a few plays written in the era in which you want to write about to get a flavour of the language.
Nursery rhymes and fables. No matter how old they are, myths, fables, folk tales and nursery rhymes have helped kick start a few ideas. Religious works have some of the greatest stories with the hardest conflicts ever told, and some of the most famous characters in history. How many books and films have their root in Noah's Ark?
Non-fiction books. History is littered with good stories to build a new tale on, while Geography and Travel books can help fill in the gaps in my own knowledge of an area. Science, real life crime and biographies can provide information needed for certain areas of a plot.
Many of my books have been bought in second hand shops over the years, and soon built up into a significant library of resources. Amazon has sellers of books that charge as little as 1p/1c (plus postage), so is another good source for old books.
That's what I have. What about you?