Does passing wind from the anus affect ritual purity?
Ablution is nullified by the passing of wind from the anus, but washing the anus is not required as wind leaves no impurity.
Is it permissible to offer Salah (prayer) on behalf of the sick who is on his/her death bed, and is incapable of offering it?
It`s impermissible to offer Salah on behalf of the sick, or the dead.
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 the Saum (Fasting) of someone who ate and drank forgetfully while offering fasting of oath expiation invalidated?
Whosoever eats, or drinks forgetfully is exempted by Allah; therefore, he/she shouldn`t break their fast whether it was obligatory, non-obligatory, or expiatory. And Allah Knows Best.