Listen to all your fans
Listen to all of your fans
Name all the states
Name all of the states
What part of language is of in these examples? Is it necessary or optional, correct or incorrect?
Of is just a preposition used to say what group or whole includes the part denoted by the preceding word:
In the case of all, half, and both; of is optional and you can either omit it or keep it.
But you can't leave out of before the pronouns us, you, them, and it *.
*You don't need to worry about this with "both" because you're not going to say "both of it" anyway.
Michael Swan says in his book *Practical English Usage:
1> All and *All of**
All (of) can modify nouns and pronouns.
Before a noun with a determiner (for example the, my, this), all and all of are both possible. American English usually has all of.
She's eaten all (of) the cake. All (of) my friends like riding.
Before a noun with no determiner, we do not usually use of.
All children can be difficult. (Not: All of children can be difficult)
Of can generally be omitted in most cases or reworded to avoid.
For "all of", you could easily replace it with "every" or "each"
In the two examples you gave, the expression could be eliminated entirely with no loss of meaning.
Listen to your fans.
Name the states.
are both clear without adding "all of" or "all"
Whenever I am writing, and I see the word "of" I stop to consider if it can be worded better.