The first time we read The Catcher in the Rye, we noticed that this red hat kept cropping up, but actually, we didn't really know what to do with it. At first it just seemed a little ridiculous. After all, Holden just berated Mr. Spencer for being the kind of old guy that "can get a big bang out of buying a [Navajo] blanket," and here he is a few chapters later admitting that he himself gets "a big bang out of that hat." At least on this level, the hat hints that Holden has the same characteristics he judges in others. But at this point, that's not really news to us. There's definitely more hidden in this hat.
Then we had to look at certain specific key passages, starting with the first time we see the hat. Holden tells us (towards the beginning of Chapter Three) that he bought the hat in New York that morning after he left all the fencing equipment on the subway and pissed off the entire team. So we know he's feeling particularly vulnerable at the time, though Holden would never admit to such a state as vulnerability.
Take a look at when Holden wears the hat, and when he doesn't. He puts the hat on at important moments – writing the composition about Allie's baseball mitt, staring at himself in the mirror and pretending to be tough after Stradlater punches him, yelling "Sleep tight, ya morons" down the corridor, etc. He takes it off when he's on the train, going to a bar, in hotel lobbies, and so forth. So while he's all about the hat in private, he's embarrassed or lacking confidence to wear it in public. We even get hints to this at the start of Chapter Thirteen ("I took my red hunting hat […] and put it on – I didn't give a damn how I looked"), the end of Chapter Sixteen ("I took my old hunting hat out […] and put it on. I knew I wouldn't meet anybody that knew me"), and the start of Chapter Twenty-One ("I'd already taken off my hunting hat, so as not to look suspicious").
But despite his embarrassment, the hunting hat becomes an important part of the way Holden sees himself. He admits it's "corny," but he personally "like[s] how it look[s]." It's a people shooting hat, he declares. When he's wearing it, he can be as insular and tough and as unique as he wants. That's why it's such a big deal when Phoebe puts it on his head at the end of the novel; not only is she giving back to Holden, but she's demonstrating that she loves him as the individual that he is – corny red hunting hat and all.