Does touching one's wife invalidate ablution?
Touching the wife according to the Shafi'ee's doctrine invalidate husband's ablution. And Allah Knows Best.
A woman used contraceptive pills, and her menses exceeded (15) days, is it permissible for her to fast?
The maximum of menstrual blood is (15) days, but if it exceeded that due to a medication, or the like, then it is Istihadah (bleeding outside the monthly period), and in this case she should perform Ghusl (ritual bath), pray, and fast. Moreover, she is obliged to make up for the missed fasting days which exceeded her regular menses. And Allah Knows Best.
Is it permissible for one to masturbate in order not to commit fornication?
This is called committing the milder of the two evils such as eating a carcass in fear of death, and this happens when committing fornication is very likely to occur.
I suffer from excessive gas, especially when I pray, and I redo my ablution more than seven times. I have obsessive thoughts about this matter, even though I went to a doctor and was given medication that did not help. What should I do?
If the release of gas stops at certain times between prayers, you should wait for that time, perform ablution, and pray. However, if it is continuous, you should perform ablution after the prayer time begins and pray, and the release of gas during the prayer is excused. And Allah The Almighty Knows Best.