These are just some basic guidelines.
State Sales Tax
You only need to pay on the royalties that you receive. You will get a 1099-Misc from Amazon (or where ever your books are sold). Use this to file with your state. If you buy books and sell them personally, you paid sales tax when you bought them.
State Income Tax
If your state has an income tax, you will need to report your 1099-Misc and the sales that you made in person.
Federal Income Tax
You will need to include the 1099-Misc and the sales you made in person.
If you consider being an author a business then you will need to fill out either a Schedule C (under $400 profit) or Schedule SE (more than $400 profit). This requires that your business is filed with your state and that you keep track of all expenses related to being an author.
NOTE – I am not a CPA or tax professional. I also do not know your specific financial situation. If you are unsure about anything to do with your taxes, please consult a professional tax preparer.