Pippin really comes into his own in the last book of the Lord of the Rings. Earlier in Fellowship of the Ring and even The Two Towers, Pippin mostly serves as comic relief. As Gandalf and Pippin arrive in Minas Tirith, Pippin begins to show another side of himself. He reveals his deep sense of loyalty in Return of the Kings, especially in his commitment to serve Denethor as a guard of the citadel, a gesture that Pippin makes out of his desire to "honor [Boromir's] memory, for he was very valiant" (739). Pippin tells Denethor that he offers his service "in payment of [his] debt" (739).
Later during the seige of Gondor, Pippin proves his loyalty to Faramir as a Guard of the Citadel. He warns Gandalf of Denethor's madness in an effort to save Faramir from a fiery pyre. When forced to choose between following Denethor's orders or saving Faramir, Pippin chooses loyalty and risks his own safety to do so.