The sentence that does not contain any errors in punctuation or capitalization is C. The curious child asked, "Why?"
Before the direct quote (in this case, "Why"), there should always be a comma. And inside the very quote, there should be a punctuation mark (in this case, a question mark) before the last quotation mark.