2

They are not always interchangeable. If you are confused what to use where, here is a tip:
We generally prefer 'whether' after prepositions. Said that, don't use 'if' in such cases.
I asked my friend about if whether she had an affair.
I am only interested in if whether you are working...