A person praying alone changing his intention to be an Imam
A Muslim enters the Masjid to find that Salah (Prayer) is over. He starts to perform Salah alone, then another person joins him, is it permissible for the first person to lead the second one and change his intention from offering Salah alone to that of leading another?
It is permissible for a Muslim performing Salah on his own to change his intention when joined in Salah with other Muslims. He may become an Imam in this case according to the opinions of scholars. The author of 'Al-Muqni`' states, 'If a Muslim begins Salah alone and then decides to be a Ma'mum (a person being led by an Imam in Prayer), his Salah is not valid according to the more correct view. But if he intends to lead Salah, it is permissible in the supererogatory Salah, not the obligatory one. However, the validity [of the obligatory Salah] remains probable and it is correct in my opinion.
End quote. Commenting on the phrase, "However, the validity [of the obligatory Salah] remains probable...," he states in "Al-Hashiyah", Indeed,
Ahmad reported some narrations in support of this view and it is the viewpoint of
Al-Shafi`y School of Jurisprudence. The author said, 'It is the correct, by Allah's will, for it is proven valid in supererogatory Salah and the supererogatory Salah is essentially equal to the obligatory one. This is further supported in the Hadith narrated on the authority of
Jabir and Jabbar. Moreover, it is a pressing need, for if a group of Muslims enter a Masjid and join a person offering Salah alone, he will either stop his Salah to tell them of his condition but this would necessitate the nullity of his devotion or he will continue Salah then tell them of his condition after it is over which will cause the invalidity of theirs, (Part No. 6; Page No. 324) which is worse and more abhorrent.
It is also the preference of Shaykh-ul-Islam
Ibn Taymiyyah (may Allah be merciful to him). Indeed, it is more correct, due to the proofs mentioned and to receive the reward of congregational prayer as well.May Allah grant us success. May peace and blessings be upon our Prophet Muhammad, his family, and Companions.