As an honorable knight, Sir Gawain has to step in when the King faces risk. He accepts the challenge for King Arthur. It proves his loyalty and dedication to the chivalry code.
Detailed answer:
The events of Sir Gawain and the Green Knight take place in Middle Age England. The Chivalry Code was the primary source of moral values for an honorable Knight. Sir Gawain was one of the Knights of the Round Table serving for King Arthur. Knights of the Round Table had to possess traits of bravery, trustworthiness, honesty, justice, and loyalty.
When the Green Knight appeared before the court on New Year’s Eve, he caught everyone by surprise. No one knew who he was and where he came from. He stunned everyone even more when he proposed his dangerous challenge of any brave man to strike him with his ax. A volunteer must find him in one year and receive the returning strike from the Green Knight. As it turned out, only Sir Gawain had enough of the chivalry traits to stand up for his King.
To sum up, Sir Gawain showed himself as a true Knight of honor. He accepted the challenge when others hesitated in fear. It does not mean that Sir Gawain is free of any fear and does not tremble at the thought of death. It means that he found the inner strength and courage to do what is right, even if it means sacrificing his life.