1. I have many books.

2. I have a lot of books.
3. Do you have many books?
4. Do you have a lot of books?
5. I don't have many books.
6. I don't have a lot of books.
-----------------------------
Are they all grammatical? Which one is ungrammatical?

All are correct.

#3 is probably used less often than #4, but both are correct.