You can deduct, as a charitable contribution, either the cost of the books or the fair market value at the time that you donated them, whichever is less. Fair market value is what you could sell them for. The fair market value of used books is usually much less than the original cost.
The records that you must have to substantiate the deduction depend on the total amount of the deduction. See the section on Noncash Contributions in IRS Publication 526, which you can read at the following link. Note that if your deduction is over $5,000 you will need a professional appraisal.
https://www.irs.gov/publications/p526/ar02.html#en_US_2015_publink1000229839
Charitable contributions are an itemized deduction. The deduction will not give you any tax benefit unless your total itemized deductions are more than your standard deduction.