When Holden's roommate, Ward Stradlater, requested him to write his English composition for him, he didn't specify a subject.
"Anything. Anything descriptive. A room. Or a house... Just make it descriptive as hell."
What Stradlater did not expect was that Holden would write about his late brother's baseball glove. Holden's younger brother, Allie, had died of leukemia several years before, and Allie was one of the few people about whom Holden has nothing bad to say. He worshipped the memory of Allie, and he kept Allie's left-handed mitt in his suitcase. The glove was covered with poems which Allie had written on it so he could read them when he became bored in the outfield. When Stradlater complained about the subject matter--"a goddam baseball glove"--Holden took it from him, tore it up and threw it in the trash.
"The Catcher in the Rye" is supposedly being written in the first person by a sixteen-year-old boy. J. D. Salinger needed to persuade the reader that Holden was capable of writing an entire "autobiographical" book, even though he was a poor student and was actually getting kicked out of school because of his bad grades. The incident involving the composition about Allie's baseball glove and the fight with Stradlater is intended to establish that Holden has a talent for writing--but only when he feels like writing and only when he can choose the topic. The reader is intrigued by the dramatic aspect of the quarrel with Stradlater and hardly realizes that he is being cunningly conditioned to believe that Holden is capable of writing "The Catcher in the Rye," a book full of subtle observations about people and about life in general.
Holden's decision to write about a baseball glove, a subject Stradlater considers unacceptable, leads to their fight, which is one of the factors leading to all the subsequent events in the novel:
"All of a sudden, I decided what I'd really do, I'd get the hell out of Pencey--right that same night and all. I mean not wait till Wednesday or anything.
It is probably significant that Holden sells his typewriter to Frederick Woodruff before leaving Pencey. This may be intended to explain why he doesn't write about his adventures and misadventures in New York until some time after these events have occurred. Salinger probably wanted to establish a temporal perspective and not risk having the reader assume that Holden was writing something like a diary or journal. The reader wants to know not only what happened but how it all ended and what it all meant. Selling the typewriter also allows Holden to establish that he is "loaded" with money because of his grandmother's generosity and can afford to spend several days and nights in Manhattan.