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.
Is it permissible to fast on behalf of the dead who died owing missed fast to make up?
His relative should fast on his behalf, and it is permissible for the guardians to give permission to non-relatives of the dead to fast on his behalf as well. And Allah Knows Best.
What is the ruling on someone who vowed to fast for two consecutive months, but failed to do so?
He is obliged to fulfill his vow by fasting for two consecutive months, but if he fails to do so then, it remains a debt on him until he either fulfills his vow, or dies. In case of his death, his guardian is supposed to fast on his behalf, or donate food from his estate in return for fasting, but if the guardian fails to do so then, it is all in the Hands of Allah.
Is the son of the sister by breastfeeding considered a mahram in Islam, and is it permissible for a woman to go for Hajj with him?
Everything that is prohibited by lineage is also prohibited by breastfeeding. The son of the sister by breastfeeding is considered a mahram, just like the son of the sister by blood, and it is permissible for him to be her mahram for Hajj and Umrah. And Allah Knows Best.