The character of Don Quixote is complex, but is easily understood by the concepts of Chivalry, which are the direct cause of his insanity and subsequent actions. Don Quixote reads extensively in old books of chivalry, stories of knights and moral acts of valor and bravery, and he comes to believe in the stories as true, even though many of them are obviously inventions. The old stories were sometimes based in fact, but they grew to be fantastic through retelling; Don Quixote, in his obsession, decides that all the old stories are fact and that he is destined to become a knight.
Throughout the story, Don Quixote tries to act in a chivalrous manner, "rescuing" people in distress and protecting the populace from "monsters." This dream is helped first by an unwitting innkeeper, and then by his "squire," the dull-witted Sancho, who while enabling Don Quixote in his delusion also acts as a moral compass of his own. By the second part, Don Quixote is starting to regain his sanity, but he still believes in the moral acts of knighthood, even though he is an object of ridicule.
Virtues of Chivalry include "mercy, courage, valor, fairness, protection of the weak and the poor, and in the servant-hood of the knight to his lord," all of which Don Quixote attempts to serve in the first part of the novel. He also practices the duties to women by defending the honor of an imaginary princess. Despite his noble intentions, the cruelties of the real world inevitably end in disaster, and by the end of the novel he is fully sane, but in understanding that the morality of the old stories is not true, he loses his will to live and dies in despair.