Whether and if
Both whether and if can be used to introduce indirect yes / no questions.
I am not sure whether she will come. OR I am not sure if she will come.
I asked whether she was interested in the offer. OR I asked if she was interested in the offer.
After some verbs we prefer whether, not if.
We discussed whether we should continue. (More natural than ‘We discussed if we should continue.’)
Whether is commonly used with or in two-part questions.
I don’t know whether she will come or not.
‘I don’t know if you will come or not’ is also possible.
Only whether is possible after prepositions.
I haven’t settled the question of whether I will accept the offer. (NOT I haven’t settled the question of if I will accept the offer.)
Whether can be used before a to-infinitive. If can’t be used before a to-infinitive.
I can’t decide whether to leave or stay. (NOT I can’t decide if to leave or stay.)
When a question-word clause is the subject of a sentence, whether is preferred.
Whether we can trust him is another matter.