Holden buys the hunting hat in New York just after he leaves the fencing equipment in the subway. The team of course hates him. Holden is feeling rather vulnerable. He buys the hunting hat to separate himself from others. He even implies it is a "people shooting" hat: a metaphor, we hope, of his alienation and isolation from others.