Wonder Boys

Professor Grady Tripp (Michael Douglas) is a novelist who teaches creative writing at an unnamed Pittsburgh university (the movie was shot chiefly in and around Carnegie Mellon). He is having an affair with the university chancellor, Sara Gaskell (Frances McDormand), whose husband, Walter (Richard Thomas), is the chairman of the English department in which Grady is a professor. Grady's third wife, Emily, has just left him, and he has failed to repeat the grand success of his first novel, published years earlier. He continues to labor on a second novel, but the more he tries to finish it the less able he finds himself to invent a satisfactory ending. The book runs to over two and a half thousand pages and is still far from finished. He spends his free time smoking marijuana.
Grady's students include James Leer (Tobey Maguire) and Hannah Green (Katie Holmes). Hannah and James are friends and both very good writers. Hannah, who rents a room in Grady's large house, is attracted to Grady, but he does not reciprocate. James is enigmatic, quiet, dark and enjoys writing fiction more than he first lets on.
During a party at the Gaskells' house, Sara reveals to Grady that she is pregnant with his child. Grady finds James standing outside holding what he claims to be a replica gun, won by his mother at a fairground during her schooldays. However, the gun turns out to be very real, as James shoots the Gaskells' dog when he finds it attacking Grady. James also steals a very valuable piece of Marilyn Monroe memorabilia from the house. Grady is unable to tell Sara of this incident as she is pressuring him to choose between her and Emily. As a result, Grady is forced to keep the dead dog in the trunk of his car for most of the weekend. He also allows James to follow him around, fearing that he may be depressed or even suicidal. Gradually, he realizes that much of what James tells him about himself and his life is untrue, and is seemingly designed to elicit Grady's sympathy.
Meanwhile, Grady's editor, Terry Crabtree (Robert Downey Jr.), has flown into town on the pretense of attending the university's annual WordFest, a literary event for aspiring authors. In reality, Terry is there to see if Grady has written anything worth publishing, as both men's careers depend on Grady's upcoming book. Terry arrives with a transvestite whom he met on the flight, called Antonia "Tony" Sloviak (Michael Cavadias). The pair apparently become intimate in a bedroom at the Gaskells' party, but, immediately afterwards, Terry meets James and becomes infatuated with him, and Tony is unceremoniously sent home. After a night on the town, Terry and James semi-consciously flirt throughout the night, which eventually leads up to the two spending an intimate night together in one of Grady's spare rooms.
Tired and confused, Grady phones Walter and reveals to him that he is in love with Sara. Meanwhile, Walter has also made the connection between the disappearance of Marilyn Monroe memorabilia and James. The following morning the Pittsburgh Police arrive with Sara to escort James to the Chancellor's office to discuss the ramifications of his actions. The memorabilia is still in Grady's car, which has conspicuously gone missing. The car had been given to him by a friend as payment for a loan, and, over the weekend, Grady has come to suspect that the car was stolen. Over the course of his travel around town, a man claiming to be the car's real owner repeatedly accosted Grady. He eventually tracks the car down, but in a dispute over its ownership the majority of his manuscript blows out of the car and is lost. The car's owner gives him a ride to the university with his wife, Oola, in the passenger seat, with the stolen memorabilia.
Grady finally sees that making things right involves having to make difficult choices. Grady tells Oola the story behind the memorabilia and allows her to leave with it. Worried that Grady's choice comes at the expense of damaging James's future, Terry convinces Walter not to press charges by agreeing to publish his book, "a critical exploration of the union of Joe DiMaggio and Marilyn Monroe and its function in American mythopoetics", tentatively titled The Last American Marriage.
The film ends with Grady recounting the eventual fate of the main characters â Hannah graduates and becomes a magazine editor; James was not expelled, but drops out and moves to New York to rework his novel for publication; and Terry Crabtree "goes right on being Crabtree." Grady finishes typing his new book (now using a computer rather than a typewriter), which is an account of the events of the film, then watches Sara and their child arriving home before turning back to the computer and clicking "Save."

Question: What did Terry agree to do for Walter?
Answer: Publish his book.