Sir Gawain and the Green Knight, probably composed between 1360-1400 AD by an unknown poet now known as "The Gawain (or Pearl) Poet", is the most important Arthurian romance of the Middle Ages in England. Even though one can argue that Sir Gawain failed his ultimate test with the Green Knight, one can also make a strong argument that Gawain represents the perfect courtly knight under very difficult conditions. Gawain's two challenges--the beheading game and temptation to adultery--frame the romance.
When Sir Gawain accepts the Green Knight's challenge on behalf of King Arthur, and beheads the Green Knight--who, to everyone's surprise, survives the beheading--Gawain then accepts the knight's challenge to meet him for a rematch. Gawain leaves twelve months later on a hard journey in the middle of winter to find the Green Knight, suffering intensely from the cold, hunger, loneliness.
On route to the Green Knight's chapel, Gawain is befriended by Lord Bercilak, who offers the hospitality of his castle--and the friendship of his wife--to Gawain. The Temptation-to-Adultery Game begins. Gawain and Lord Bercilak agree, at the end of each day, to exchange what each has won during the day, and Lord Bercilak goes out to hunt each day, while Sir Gawain remains in the castle to entertain Lady Bercilak.
Adhering to the requirements of the courtly lover, Gawain flirts with Lady Bercilak, but flirtation is the limit:
[Gawain and Lady Bercilak] in companionship took such pleasure together/in sweet society soft words speaking,/their courteous converse clean and clear of all evil,/that with their pleasant pastime no prince's sport compares. (Stanza 42)
Courtly love, in its most traditional form, is a dance of words and gestures (and light touching) designed to show the knight's complete devotion to the lady while avoiding, if the lady is married, actual adultery. Gawain's situation as courtly lover is complicated by the fact that he is the guest of Bercilak, and a betrayal of one's host would be not only a repudiation of the courtly love tradition but also a breach of feudal loyalty. In other words, Sir Gawain is walking on a tight-rope: he cannot offend Lady Bercilak, who is constantly tempting him, and he cannot be dls-loyal to Lord Bercilak, his host.
Everyday for three days Lady Bercilak escalates her temptations, but Gawain, as the perfect example of the courtly lover, manages to balance the lady's temptations and courtly love requirements with his position as guest:
Thus she tested and tried him, tempting him often,/so as to allure him to love-making, whatever lay in her heart. But his defence was so fair that no fault could be seen, nor any evil on any side, nor aught but joy they wist. (Stanza 61)
From a courtly love perspective, Gawain handles the lady's temptations graciously and, most important, without offending her. For the first two days, the courtly dance ends with a kiss. As Gawain agreed with Lord Bercilak, when Bercilak gives Gawain the animals he has killed during the day's hunt, Gawain gives Bercilak what he has earned from Lady Bercilak, a kiss.
Gawain's ability to honor the requirements of courtly love and his loyalty to Lord Bercilak exemplifies his understanding of both courtly love and feudal loyalty. Gawain's failure to disclose his last gift from Lady Bercilak constitutes a flaw in his knightly behavior, but that is a different issue.