"If" is the more common and most functional of the two words; much more common and versatile than "whether"
"If" is correct in your 1st and 3rd sentences: If you punch me, I will punch you back. If you shout me dinner, I will shout you drinks. I don't know if it is true/I don't know if it is true, or not. I don't know if it is true, or just a rumour.
"If" is only concerned with one decision, or one yes/no answer. Like the logic in computer systems IF xxx >= 5, do this, IF xxx <=4 do this.
"I don't know whether it is true" is correct. I guess there is an implication in the phrase "true or not (true)". See next sentence. "Whether you do this, it will happen" is incorrect.
"Whether" is used when there are 2 choices/options. Whether is is true, OR NOT.
Whether you do this, OR NOT, then xyz will happen. Whether you join us for the party, or not (join us), we will have a good time. Whether it is sunny or cloudy, we will still be sailing.