Is it possible for an AI to learn how to speak from books as training sets?
It is possible

The Recurrent Neural Network architectures help in building efficient NLP algorithms, which can identify semantics and their relations across long pieces of text.

With very minor tuning, they can be made generative too. So, here is an excellent article on RNNs which I highly recommend, which also talks about how an RNN was trained on Shakespere's texts and wrote one itself.