In real life, you will not know if what someone says is a quote from a book or his own words, if you don't know the text that person is quoting from.
For example, if you are familiar with the Terminator movies and someone says "hasta la vista, baby," you might realize that they are quoting Arnold Schwarzenegger, but if you have never seen those movies you might think they have been taking Spanish classes.
To complicate things even more, even if you have seen the movie and recognize the phrase, you cannot be sure that the person is actually quoting it. Unless the person speaking is making a quotation mark gesture or speaking in a Schwarzenegger-like voice, they might have learned the phrase elsewhere or come up with it on their own.
Since dialogue in fiction mimics real life verbal behavior, you must not use quotation marks around quotations within dialogue. Any explanation of the quote must come from within the fictional world, e.g. the character is explaining that they are quoting a text, or the narrator explains that it is a quote. If the character is speaking in a special voice, mark up that voice (e.g. in italics) or let the narrator say that they are now speaking in such-and-such a voice, but do not use quotation marks within quotation marks (that is reserved for non-fiction quotes-within-quotes).