Well, that's easy... they go at the end of a question, right? Yes, but when your sentence has other punctuation marks, the question becomes a bit hairier and it's not always so clear. The position of the question mark is always logical, though sometimes a compromise is needed to avoid two question marks close together, and sometimes the convention prohibiting its use with the comma ignores logic. Check out the following examples.
- The question mark should never be used with a period, except, of course, when the period is not a true period but merely a point indicating an abbreviation: Is the proper form Ms. or Mrs.? It can be used with points of ellipsis, too—points of ellipsis are not true periods.
- The question mark should not be used with the comma.
- This causes a problem when the question mark ends a quotation and the sentence continues. He asked, "Why me?" which seemed an odd question seems underpunctuated, because if the quotation were not a question, a comma would signal both the end of the quotation and the beginning of the second clause, as in He said, "I suppose I deserve it," which seemed an odd remark.
- Nevertheless, He asked, "Why me?," which seemed an odd question is wrong, and He asked, "Why me?", which seemed an odd question, with the comma after the closing quotation mark, is doubly wrong. The comma should not be used even though using it would be quite logical.
- An exception is sometimes made when the question mark actually has no function in the sentence but is part of a title: His first poem, titled "Why Me?," was dedicated to his mother. This exception has some merit. Other exceptions are made in certain scholarly, legal, and other contexts beyond the scope of today's post.
- Combining the question mark with the exclamation point—Why me?! or Why me!?—is usually frowned on as childish.
- He told me—who would have expected it?—that he had married again logically puts the question mark within the dashes that enclose the parenthetical question.
- But do you suppose—? is an acceptable use of the dash and question mark to indicate a question that is cut off abruptly. However, the dash alone is sufficient if the phrasing indicates a question, as in the example. A novelist who too frequently combines dash and question mark in dialogue may leave readers feeling that all characters are in a constant state of wild conjecture, psychotic indecision, or speechless wonder.
From The Handbook of Good English by Edward D. Johnson.