In the case of very short words or phrases that might otherwise appear as nested quotations (quotations within quotations), you have the option of italicizing the nested wording—at least in situations where such wording isn't a quotation at all but simply a word or phrase standing for itself. In your examples, this is how the treatment would look:
“The answer to this question has to be yes.”
Because the rhetorical question must be answered no.
It is certainly not wrong to use nested quotation marks as you do in the original example 1 or lone quotation marks around a single word as you do in the original example 2. But some style guides—including the Chicago Manual of Style, fifteenth edition (2003)—recommend using either italics:
6.73 Indirect one-word question. When a question within a sentence consists of a single word, such as who, when, how, or why, a question mark may be omitted and the word is sometimes italicized. [Cross reference omitted.]
[Relevant example:] The question was no longer how but when.
or no special styling at all:
11.44 Single-word speech. Words such as yes, no, where, how, and why, when used singly are not enclosed in quotation marks except in direct discourse. [Cross reference omitted.]
[Relevant example:] Ezra always answered yes; he could never say no to a friend.
in such situations.