Mistaken identity is the central comic device of Nikolai Gogol's The Government Inspector. The entire plot turns on the town's error in taking Khlestakov, a penniless, idle clerk, for the important government inspector they dread, and from this single mistake all the play's satire and humour flow.
The origin of the mistake. The officials, guilty and fearful, hear that an inspector is coming in disguise. When they learn that a stranger has been staying at the local inn for some time without paying, and behaving mysteriously, they leap to the conclusion that this must be the inspector travelling incognito. In their anxiety they interpret Khlestakov's every ordinary word and action as proof of his official importance. The mistake is thus born of their own guilty imagination.
Khlestakov's exploitation of the error. At first Khlestakov does not understand why he is being treated with such deference. Once he realises the officials have mistaken him for someone powerful, he plays along with relish. He accepts their bribes, boasts extravagantly about his supposed importance and connections in the capital, courts both the Mayor's wife and daughter, and enjoys the hospitality lavished on him. His absurd exaggerations are swallowed whole by the terrified officials, which produces much of the comedy.
Mistaken identity as a tool of satire. The device is more than a comic accident; it is Gogol's means of exposure. Because they believe Khlestakov can ruin them, the officials rush to reveal their corruption, bribing him and flattering him, and so condemn themselves out of their own mouths. Mistaken identity therefore functions as a mirror in which the town's dishonesty is reflected.
The unmasking. The mistake collapses when the Postmaster intercepts Khlestakov's letter, in which he laughs at the fools who have entertained him. The officials realise too late that they have been deceived by a nobody. The final announcement that the real inspector has now arrived caps the irony, leaving them petrified.
Conclusion. The use of mistaken identity in The Government Inspector drives the plot, generates its humour, and serves its satire. By having a worthless clerk mistaken for a powerful inspector, Gogol lets the corrupt officials expose themselves, turning a simple error into a devastating comment on human folly and dishonesty.