Woody Allen's nakedly auto­biographical film is the Oscar-winning sensation which put him on the map – and it's probably his best film, too.

This fictionalised account of the rise and fall of a "nervous romance" between Jewish New York comic Alvy Singer (Allen) and the willowy, Waspy Annie Hall (Diane Keaton) was the high-water mark of Allen's gift for sublimely touching and funny screen comedy. It is a gloriously convincing romance, packed with superb gags. Annie Hall also virtually invented the relationship comedy in both movies and literature; it made possible the now degraded romcom genre, and on TV it spawned Seinfeld, Curb Your Enthusiasm, Sex and the City, and Entourage – though none of these have anything like Annie Hall's passionate romantic pain.

It is an ancestor of the work of Charlie Kaufman, which comes closer to Allen's own darkness. Throwaway jokes about Alvy's paranoid encounters with his TV-watching public look very contemporary in our celeb-happy age. The sensationally funny and daring cameo for Marshall McLuhan, who magically appears in a cinema queue to tell some loudmouth academic that he is wrong and Alvy is right, is an inspired and sophisticated flourish. It depended on a literate audience, who would also be tickled by the idea of a Henry James novel called My Sexual Problem. The film's concluding device – the ecstatic montage of his lost relationship's most poignantly magical memories – incidentally lives on in the Big-Brother-reality-TV convention of showing the departed competitor his or her best moments in the house.

The fact that the movie was originally to be entitled Anhedonia, that is, the clinical inability to experience happiness, has become part of its legend, especially because the film has given everyone so much happiness. It was, in fact, the movie which introduced us most fully to Allen's very serious obsession with death: how fleeting life is, how dependent on chance, and how overshadowed it is by the thought of its approaching end. Life is negligible and horrible, like the food in a restaurant in the Catskills-type joke Alvy tells at the very beginning: terrible, and such small portions. But in Annie Hall the mortality that weighs most heavily is the mortality of his love affair. There are no wedding bells or happy endings, and that is what gives the movie its sting. Allen also captured something in Keaton which can't be described except in cliches: kookiness, wackiness, ditsiness. They have a sexual relationship, and yet Keaton is not portrayed in a very sexualised way: she looks beautiful, but shambolically real.

The question at the heart of the film is: what went wrong? How did the romance die? Alvy introduces his story as an autopsy, a re-examination of his life and behaviour, and a doomed attempt to find out why his relationship with Annie failed. There is no answer: just a deeply touching, funny, brilliantly told story.

When I first saw the film, I remember being stunned with Allen's sheer audacity in the scene where he remembers his old schoolroom, sitting alongside kids who harangue him in adult language about his sexual precocity: "For God's sake, Alvy, even Freud speaks of a latency period!" One extraordinary girl in glasses addresses the camera and says: "I'm into leather."

I've never been able to watch Annie Hall without pondering the fact that this child is now an adult. Where is she now? Alvy Singer, like Woody Allen, tries writing scenes based on his own life: to make sense of them, to lessen the pain, to understand what happened, and still the truth eludes him. This wonderfully funny, unbearably sad film is a miracle of comic writing and inspired film-making.