Monday 26 December 2011 19.01 EST
First published on Monday 26 December 2011 19.01 EST

Chinatown is a detective story. It's set in Los Angeles, like many of the best are, and at first glance you could even mistake it for a tribute to the city. Roman Polanski's film escorts you around it, encourages you to bathe in the rich Californian light and take in the lush vistas. It's only at the end you realise the tour has been slowly, almost casually, ushering you into a room containing the most depraved human wickedness imaginable. Chinatown is definitely my favourite film.

Growing up, I spent a lot of time with private detectives. After teething on the Hardy Boys, I moved on early to the hard stuff, starting with Sherlock Holmes and, via a number of workmanlike franchise tecs and a smattering of gentlemen investigators, ending up at Marlowe and Sam Spade. I liked detectives more than policemen; they were rebellious, followed their own instincts and always had a decent one-liner as well as a revolver to hand. That the detective novel is reliant on conventions probably helped, too. The femme fatale, the unexpected blow to the head, the final twist, they're all to be expected in a standard case and that's easier for a 10-year-old mind to get a handle on. It also leads to a change in expectations when reading a story; the aficionado takes pleasure from seeing familiar elements delivered in a novel way.

Jack Nicholson in Chinatown Photograph: Ronald Grant Archive

I watched Chinatown for the first time when I was 19. I was a student taking a well-deserved afternoon (or was it week?) off. Half a dozen of us hunkered down in somebody's bedroom and closed the curtains. I was ready for some classic PI action with a modern twist, and as the sepia credits rolled and Gittes was sold his first dummy (the Mrs Mulwray in his office is an imposter) everything was as it should be.

I wasn't prepared, though, for what would happen next. I wasn't ready at all. In Chinatown, Jake Gittes is duped by duplicitous women, beaten senseless by heavies and performs an act of deception in a public records office. Conventions are observed. But when it came to the grandest convention of all – the final twist – both he and I had the rug pulled out from underneath us.

A still from the Roman Polanski film CHINATOWN, Jack Nicholson and Faye Dunaway, 1974 Photograph: Everett Collection / Rex Features

Burned on my brain is the moment Gittes beats the truth out of Evelyn Mulwray about that pale girl locked in the safe house. As is the line from the subsequent scene in which Gittes attempts to confront Noah Cross over his depravity: "You see, Mr Gits," replies Cross, willfully mispronouncing his name, "most people never have to face the fact that at the right time and the right place they are capable of … anything." Put it this way: you don't get much of that in Lord Peter Wimsey.

I came into Chinatown expecting a genre piece; I left chilled and overwhelmed by an emotional intensity I had rarely experienced in my books. I decided immediately that Chinatown was my favourite film. But it also continued to niggle at me. I wanted to know why it unsettled me so much. The abominable scale of the crime was certainly part of it, but not all. It was also the way in which assumptions were undermined across the piece. The generic form was a prime target – most of the action taking place in bright sunlight rather than the normal pitch darkness, the dialogue delivered not in florid bursts but tersely. But there were other, more important things under assault, too.

Jack Nicholson in Chinatown Photograph: Ronald Grant Archive

When the film was released, Jack Nicholson explained that Chinatown was Polanski's assault on a city he was simultaneously making so beautiful. "Roman was just letting everyone know how he feels about LA," Nicholson said. "It was a place where blood always flows." Polanski's wife and unborn child had been murdered by Charles Manson's cult in the city five years previously. This surely had some influence on the tone of his film. But in the way it smashes optimism against a wall of amorality, Chinatown is surely attacking more than just LA.

Gittes is a hero, a good detective who knows his trade and someone who, despite his uncouth manner, aspires to doing the right thing. He is also shocked, almost overwhelmed, by what he encounters in the Mulwray case. Perhaps this is because Gittes's previous experience is only in the predictable world of marital surveillance, but perhaps not. Perhaps he's actually a truly moral guy who can't believe what he's seeing.

I think you are inclined to believe this interpretation of Gittes because he's being played by Nicholson. The wild-eyed incomprehension, an unwillingness to engage with the reality around him, is something viewers had seen in Nicholson's earlier idealistic rebels of Five Easy Pieces and The King of Marvin Gardens. Nicholson was a hero of the new Hollywood. Here, though, he was cast as a proxy for the liberalised baby boomer, a proxy for the audience. And Polanski had cast him on purpose, in order to tear him and his beliefs to shreds.

After much internal investigation, I decided that was why Chinatown unsettled me so much. One film had undermined my trust in the detective novel, and all the conventions I had become comfortable with as a youth. But it was also pulling at the foundations of other things I believed in; not just the code of the private detective, but that of morality, too. It's fair to say that working out why Chinatown had moved me so much did not make things feel any better.