Just as where is the wh-word that goes in front of questions about location, whether is the wh-word that goes in front of yes/no questions when they're subordinated:
- Is he going (or not)? ~ I wonder whether he's going (or not).
Since yes/no questions imply a binary choice, a conjoined or not phrase may often be added.
For the same reason, embedded question complements headed by whether can often use if instead:
- I wonder if he's going (or not).
Unlike other wh-words, whether is never used to mark a regular question:
because yes/no questions already do that without a wh-word.
In this case, whether can introduce two conjoined infinitive clauses
- whether for me to buy sugar puffs or whether for me to buy coco pops
reduced by conjunction reduction by deleting the optional boldface above, to
- whether to buy sugar puffs or coco pops
So it's fine provided it is introducing a yes/no question or some binary opposition.