Final answer:
Jim Halpert wears a costume and a moustache in 'Branch Wars' of 'The Office' to show loyalty to Michael Scott and because he's entangled in Michael's prank plan for the Utica branch.
Step-by-step explanation:
In the episode "Branch Wars" of The Office, which is a U.S. television series, Jim Halpert agrees to wear a costume and a moustache primarily out of loyalty to his co-workers, particularly Michael Scott. Jim is persuaded to participate in Michael's misguided mission to prank the Utica branch.
He dons the moustache and warehouse uniform as part of a scheme meant to appear as though they are from a rival paper company. Ultimately, Jim agrees to the costume because he gets caught up in Michael's enthusiasm and doesn't immediately know how to refuse the situation without causing conflict.