Is "of" needed here? "I have no idea of what to do"
- I have no idea of what to do.
- I have no idea what to do.
Q1. Can we use both expressions? Are both grammatical?
Q2. Is 'no idea' in apposition with 'what to do'? What is the relationship between them?
Solution 1:
Note: My answer addresses the question posed in the header: "Is 'of' needed here? 'I have no idea of what to do'." In the course of answering that question, I note some evidence that people have used both "no idea what" and "no idea of what" for at least the past 100 years, and I see no reason to doubt the grammaticality of either form. I did not pursue the question of whether "no idea" is in apposition to "what to do".
The decision to include or omit an explicit preposition in statements of the form "I have no X what to do"—where X is a noun that makes logical sense in that construction—varies from noun to noun. Most English speakers are so accustomed to preposition-free usage of the form "I have no idea (as in "I have no idea where to go" or "I have no idea why I'm here") that the absence of a preposition after "idea" seems completely normal to them.
An Ngram chart comparing the frequency of occurrence of "no idea what" (blue line) versus "no idea about what" (red line) versus "no idea of what" (green line) during the period 1920–2008 indicates first that use of the form "no idea what" has been more frequent in written English throughout the period and second that it has increased rather dramatically since about 1970:
However, a very different pattern emerges in an Ngram chart comparing the frequency of occurrence of "no opinion what" (blue line) versus "no opinion about what" (red line) versus "no opinion of what" (green line) during the same period:
This suggests that the felt need for a preposition after the noun X in the phrase "I have no X what" depends to a very great extent on the particular noun involved. Put another way, i indicates that the reason that most English speakers don't feel a need to include a preposition in the phrase "I have no idea what" is more idiomatic than syntactical. If it ere syntactical, they would presumably apply the same logic to the phrase "I have no opinion what"—which some do but most don't.
Another point of interest involves the difference in the treatment (again in published writing) between "I have no idea what" and its preposition-friendly alternatives (on the one hand) versus "I have an idea what" and its preposition-friendly alternatives (on the other). Compare the first Ngram chart above to the following one, which compares the frequency of occurrence of "an idea what" (blue line) versus "an idea about what" (red line) versus "an idea of what" (green line) during the same period:
The phrase "an idea of what" is far more common in the Google Books database than the phrase "an idea what"—even though a spot check of the underlying Google Books matches indicates that the line for "an idea what" incorporates many more false positives than does the line for "an idea of what." It also seems noteworthy that "of" is the dominant prepositional form in the phrase "an idea of/about what," whereas "about" is the dominant prepositional form in the phrase "no opinion about/of what."
These various fragmentary results suggest to me that usage involving expressions of the form "no idea what," "an idea what," and "no opinion what"—with or without the preposition "about" or "of"—is strongly influenced by seemingly arbitrary idiomatic preference. That is, the form that predominates in a particular instance seems to have emerged through happenstance rather than through syntactical necessity.
Solution 2:
The answer to your first question is no. Unlike the noun idea, which collocates with prepositions of, about, and for, the idiom to have no idea does not take a preposition. It functions as a verb meaning not to know and takes a noun phrase for a direct object, hence the answer to your second question.
I have no idea [what to do] = I don't know [what to do].