What is the ruling of Islamic Law on following the actions of the imam in prayer and how this following is achieved?
Praise be to Allah, and peace and blessings be upon our master, the Messenger of Allah.
The follower (ma'mum) is required to follow his imam in the actions of the prayer. This "following" (mutaba'ah) means that the follower performs each action of the prayer after the imam has begun it but before he has finished it. For example, the follower bows (in ruku') after the imam has reached the position of bowing, then rises after the imam has risen. The Prophet, peace and blessings be upon him, said: "The imam is only appointed to be followed, so when he says the takbir, say the takbir; and when he bows, then bow; and when he prostrates, then prostrate" (agreed upon, i.e., reported by both al-Bukhari and Muslim).
It is stated in Mughni al-Muhtaj (1/505): "Among the conditions of valid congregational prayer (iqtida') is following the imam in the actions of the prayer... meaning that following the imam is obligatory in the physical actions of the prayer, not in its verbal utterances... Complete following (kamal al-mutaba'ah) is achieved when the follower's beginning of an action comes after the imam's beginning of that same action, while the follower's beginning of the action precedes the imam's completion of it" — end of quote, with slight paraphrasing.
And Allah, the Exalted, knows best.
Is the marriage contract considered valid if concluded at home by the marriage official (Ma`zon)?
Yes, it is valid as long as it is registered at the court.
Is it permissible for a pious Muslim woman to stay with her husband who had quit praying out of laziness?
Quitting prayer is one of the major grave sins that come after disbelieving in Allah, but the wife of such a person isn`t considered divorced, rather, she should exert all her efforts in order to bring him back to the way of Islam. However, if his sin is likely to lure her from the way of Islam, then she had better separate from him by lawful means such as Mokhal`aa (When a wife pays a compensation for her husband in return for divorcing her). Moreover, if she exercises patience, and remains steadfast on her faith, then there is no harm in doing that.
What is the ruling on praying in congregation at the mosque?
Praise be to Allah, and peace and blessings be upon our Master, the Messenger of Allah.
Congregational prayer (Salat al-Jama‘ah) is a communal obligation (Fard Kifayah) for resident men regarding the performance of the prescribed (obligatory) prayers. For men, praying in congregation at the mosque is better than praying elsewhere, such as at home. On the authority of Abdullah bin Umar, the Messenger of Allah ﷺ said: 'Prayer in congregation is twenty-seven degrees more excellent than the prayer of a person alone' (Reported by Bukhari & Muslim). Furthermore, on the authority of Abu Hurayrah, the Messenger of Allah ﷺ said: 'Shall I not tell you that by which Allah erases sins and raises ranks?' They said, 'Of course, O Messenger of Allah.' He said: 'Performing wudu thoroughly despite difficulties, taking many steps toward the mosques, and waiting for the next prayer after the prayer; that is your Ribat (steadfastness)' (Narrated by Muslim).
As for a woman, her praying in congregation at home is better for her than in the mosque, according to the saying of our Master the Prophet ﷺ: 'Do not prevent your women from attending the mosques, but their homes are better for them' (Narrated by Abu Dawood). Young boys should be encouraged to attend the mosques and congregational prayers so they may become accustomed to them. And Allah the Exalted knows best.