The two ways of relating what a person has said are 1)direct and 2)indirect (reported speech).In direct speech, the original speaker's exact words are repeated. Direct speech is found in plays and quotations. In indirect/reported speech, the exact meaning is expressed but not necessarily using the original speaker's exact words. Pronouns and possessive adjectives usually change from first or second person to the third person except when the speaker is reporting his own words. Sometimes a noun can be inserted to avoid doubt.
Option D is correct as if is used,simple past tense is changed to past perfect tense, you to he, to which is used to join the two statements, and negatively is used in place of no, and didn't is changed to hadn't.
Options A,B, and C are wrong as if is not used, if is missing and broke cannot be used respectively.
The correct answer is D)Sam asked Sue if he had broken into the shop to which Sue replied negatively and said that she hadn't.