Colloquially, to a native English speaker, the distinction in most of the sentences you cite is a small one. You would certainly be understood with either usage and most listeners would not even notice a problem. (Though, as commenters have noted, the bigger problem is that you have to say "rather than" in this construction.)
However, the proper grammatical usage is the infinitive construction. Why? Because that's the documented idiomatic construction and not really for any other reason.
Now, you might properly use the -ing construction in the following construction:
It is better to be swimming rather than [to be] running.
In that sentence, you would be using the infinitive of "be" which then requires an -ing form of the verb. (Thus, we are still using the infinitive after "rather than", but we have inserted the verb to be so that we can use the gerund form. The second to be is optional because it is implied already by the first to be.) There is a subtle distinction between the two sentences:
It is better to swim rather than [to] run.
It is better to be swimming rather than [to be] running.
These sentences above are not really interchangeable. The first makes a general point about the two forms of exercise (probably about the health effects), whereas the second sentence seems to comment on the time period during the action (perhaps it feels more pleasant or enjoyable).
Now, in your sentence #5, you should definitely say "to avoid using." Why? Because certain verbs take "to verb" constructions and others take "verb-ing" constructions:
I prefer to use chopsticks. [Correct]
I prefer using chopsticks. [Can be correct in the right context, emphasizing the time during the action.]
*I avoid to use chopsticks. [Incorrect. Avoid doesn't take a to+verb after it.]
Don't confuse the above constructions with:
I breathe to live. [I.e., I breathe in order to live.]
I was born to run. [I.e., I was born in order to run, a poetic way of saying that running is my reason for living.]
I was born running. [I came out of the womb with my legs running (probably a metaphorical use).]
Those are all different meanings and different grammatical constructions, even though they look similar.
These two are your best options
I sent an email to apologize for (insert relevant circumstances)
or
I sent an email apologizing for (insert relevant circumstances)
In the second example, you simply need to change the position of "apologizing" and "for"
Best Answer
I think it is usual to use that as a conjunction in these examples.
See the definition that:
So I would write them as follows:
Also check the definition recommend and you can see this form: