Correct option is A
Option (a) contains an error.
Error identification: "Sudden" should be "Suddenly."
Grammatical Rule used: "Suddenly" is an adverb and is used to modify the verb "remembered."
Corrected sentence: And thereupon he suddenly remembered that he was not sleeping in his wife's room, but in his study.
Meanings of all options:
Sudden: Happening or coming unexpectedly.
Suddenly: Quickly and unexpectedly (correct form).
Remembered: Recalled from memory.
Study: A room for reading or work.