The fact that Crime and Punishment is set in a city has a significant impact on the action of the story and the meaning of the action.
Roskolnikov hopes to prove that he is a man above other men. He wishes to be separated by superiority, separated from the mass of men by an ethical and intellectual integrity which will be proven by his ability to commit a murder and get away with the crime.
The novel explores all the ways in which Roskolnikov fails to achieve his aims. He does not rise above the masses, but finds himself plunged deeper into the group of wretched people in the city. He is surrounded by people who he can neither connect to nor escape from.
The police investigators are city policemen, accustomed to crime of a certain sort. Roskolnikov’s uniqueness is seen in the police response to his particular crime and his particular motivation. Yet it is also the city police investigators who demonstrate how far Roskolnikov really is from being the superior man he had hoped. Men accustomed to dealing with common criminals have no trouble capturing Roskolnikov and are even able to manipulate him with relative ease.
Set in the countryside, the themes of “one among many” and “striving for superiority over the masses” would have played very differently.