The Apostle of Allah (PBUH) said (approved as strong hadith by all the Islamic schools):
“I am leaving among you two weighty things: the one being the Book of Allah in which there is right guidance and light, so hold fast to the Book of Allah and adhere to it. He exhorted (us) (to hold fast) to the Book of Allah and then said: The second are the members of my household I remind you (of your duties) to the members of my family.” 
Yazid b. Hayyan the attributed narrator of this hadith added: “He (Husain) said to Zaid: Who are the members of his household? Arent his wives the members of his family? Thereupon he said: His wives are the members of his family (but here) the members of his family are those for whom acceptance of Zakat is forbidden. And he said: Who are they? Thereupon he said: Ali and the offspring of Ali, Aqil and the offspring of Aqil and the offspring of Jafar and the offspring of Abbas. Husain said: These are those for whom the acceptance of Zakat is forbidden. Zaid said: Yes.
Islamic nation is asked to hold fast of two weighty things after the Prophet (PBUH): the Quran, the only infallible book lasting on the earth, which will guide them to the right path and unify the nation word. It have the word of ALLAH (glory for Him) and the law that the people should follow to be successful believers whether material, spiritual or any other dimension.
“This is the Book (the Quran), whereof there is no doubt, a guidance to those who are Al-Muttaqûn [the pious and righteous persons who fear Allah” Quran 2:2
Thence, the Quran is guidance light to Islamic nation that will take them from the darkness of ignorance to light of knowledge and wisdom. The Quran with it is eloquent meanings and powerful message have left the generations since the revelation to ponder on its great knowledge which encompasses in this World, where the human being live within, and the Hereafter. Many scholars and interpreters have produced several encyclopedias of interpretation and tried to extend the human understand in both relatively and irrelatively from time, place and the overseen world.
Therefore, a revealed book with such powerful contents requires an infallible messenger to state and explain its correct meaning in relative to people capacity. Cause the case is similar to the constitution books, which requires law experts for deriving the right meaning and project the appropriate rule.
The Prophet (PBUH), the best mankind, was chosen by ALLAH (glory for him) to accomplish this mission, that He perfectly did complete it in the best way and appliance.
But as the practice of ALLAH (glory for him) never changes (refer to Quran verse 33:62), so there should be always a Guider :
“Surely We have sent you with truth as a bearer of good news and as a warner, and there was no nation without a warner having passed among them.” Quran 35:24
The nation requires always a divinely guided person to show the people the right way and to unify them to the right word to what they do continuously dispute. Thence, the necessity of the second weighty element in the hadith of the Prophet (PBUH), by having an infallible guidance throughout time. Nations cannot suffice only with the Quran, as the Holy book contains enormous knowledge and people could easily misinterpret it if they are not fully aware of the verses constraints and deep meaning. So the mission of the Prophet (PBUH) was not completed till He announced what ALLAH (glorify for Him) asked, by assigning the successor after Him(PBUH) who will be responsible on guiding the nation and deriving the rightful law for new occasions from the Quran and the Prophet path.
“O Messenger, convey all that has been sent down to you from your Lord. If you do not, then you shall not have conveyed His message (at all). Allah shall protect you from the people. Surely, Allah does not lead the disbelieving people to the right path.” Quran 5:67
Therefore, the Prophet (PBUH) assigned Imam Ali ibn Abi Taleb, His cousin and the gate of his knowledge  to be his successor for guiding the nation after Him. (refer to Ghadir Khum event for further details ).
And so the guiders of this nation after the Prophet (PBUH), as mentioned in the above hadith, are twelve (hadith of the twelve Imams ) Imam Ali (PBUH) and His offspring (PBUTH):
Imam Ali ibn Abi Taleb(as): the cousin of the Prophet(PBUH) and husband of his daughter Fatima(as). Imam Ali(as) was born inside the Kaba , on 13 Rajab in 30 Am al-Fil (the year of the elephant) & was struck by a sword in the Kufa Mosque & was martyred on 21st Ramadhan 40 AH and is buried in Najaf on the outskirts of Kufa, Iraq.
The prophet Mohammad(PBUH) said: This Ali, is my brother and successor listen and lend ears to what he says and obey his orders. 
Imam Hassan(as): grandson of the Prophet(PBUH) , son of Imam Ali(as) and Fatima(as). The second Imam was born in Medina, on the night of the 15th day of Ramadan, three years after the hijra (624 AD). Imam Hassan(as) was martyred by a poison, he is buried in Jannatul Baqee, Medina
The prophet Mohammad(PBUH) said: “ Hassan and Hussein are masters of youth in Paradise”.
Imam Hussein(as): brother of Imam Hassan(as). Third Imam was born3 / 5 Shaaban 4 hijra in Medina.
Refused to pledge allegiance to what the unjust rule of the Umayyads, Cliphate at that time was Yazid ibn Mu’aweya ibn Abi Soufyan. He said: “Yazid openly commits acts of immorality, indulges in drinking and kills innocent souls. A person of my stature cannot pledge allegiance to a lowly person like him” 
As a consequence fearing bloodshed, he left his home town and heading for Kufa, On the way his caravan was intercepted and he was killed and beheaded in the Battle of Karbala in 61, and buried there.
Prophet Mohammad(PBUH) said: Hussain is from me and I am from Hussain.[7 ]
Imam Ali ibn Hussein– Zein Al Abideen(as): he was born in 38 AH. He is the source of the Saḥīfa al-Sadjadiyya, commonly referred to as the Psalms of the Household of Muhammad.
He was killed by the Bani Umayyah rulers. By the instructions of Walid Bin Merwan, the governor of Medina. Imam Ali (as) was poisoned by Hisham ibn Abd al-Malik, at age of 57 years. And is buried in Jannatul Baqee, Medina,
Imam Mohammad ibn Ali – Baqir(as): was born on 1st of Rajab, 57Hijra. The Imam was given titel Baqir al-‘Ulum Revealer of Knowledge because of his sufficient religious and judicial knowledge and his enthusiasm to learn and teach.
Prophet Mohammad (PBUH) told one of his companion Jabar about the Imam(as): “O Jabir, you will have a long life, and although you will go blind, but you will meet the 5th in line of my descendants whose name will be my name, who will walk like me and who will be the 5th Imam of the time. When you will meet him, give my salaams (peace greetings) to him”.
He(as) was poisoned during Umayyad rule at the age of 57 years and buried in Jannatul Baqee’.
Imam Jafar ibn Mohammad – Sadeq(as): was born in 17th Rabi al Awwal, 83 Hijra. The main source for the AhlulBayt jurisprudence school, for his great knowledge he was known as Imam, scientist, physician, philosopher, Islamic theologian and astronomer.
The Imam(as) during his time have established a school where narrations mentions thousands of scholars was graduated under his teaching. From these are the famous chemist Geber, the founders of other Islamic school of thought: Abu Hanafia, Malik ibn Anas, Wasil ibn Ata (Mu’tazili).
The Imam(as)’s time was the most time were the AhlulBayt followers were partially permitted to express their views and openly learn and teach their thought.
Imam Mosa ibn Jafar – Kazem(as): was born 25th Rajab, 183 Hijra , regarded by different schools as a renowned scholar. The Imam(as) besides his vast knowledge he was known of his great patient hence his title Kazim ‘ great controller of anger’. The Imam(as) was continuously oppressed by the Abbasid ruler at the time, Harun al-Rashid. He was transferred from prison to prison during his life, then the ruler ordered to poison him after the long torturing and separation from the people and his family.
he died at age of 55 years, and buried in Kadhimayn, Iraq.
Imam Ali ibn Mosa – Rida(as): was born 11th Dhul Qidah. The Imam(as) known by Rida ‘Pleaser’ as throughout the struggle and oppression he faced from the rulers at his time, all his actions was wisely taken in pleasing ALLAH(glory for him). Hence, he refused the Ma’mun, Abbasid ruler, offer to be involved him in the corrupted governmental rule even with force.
He is very known in the golden chain narration, which is quoted by him from his fathers to Imam Ali(as) than the Prophet(PBUH) who narrated the words of Gabriel(as), who quoted the diving words of ALLAH(glory for him) : There is no God but Allah, the One is My stronghold in which the reciter of this holy verse can enter and then he will dwell there safely, and will not suffer My wrath then added :But all this depends on some conditions, and I am considered to be one of those conditions.
The Imam(as) was poisoned by Ma’mun and died at age of 55, and he is buried in Mashhad, Iran.
Imam Mohammad ibn Ali – Jawad(as): born in 10th of Rajab, 195 Hijra. The Imam was well known of his great knowledge at a very young age. Many narrators have listed stories where the Imam was so eloquent in showing the right jurisprudence actions in many debates with great scholars of that time such as the Qadi, Yahya bin Aktham.
The Imam(as) was poisoned by his wife, the daughter of Maemun (Abbassid ruler), which He married her by force. And at age of 26th and buried in Kadhimayn, Iraq.
Imam Ali ibn Mohammad – Hadi(as): was born 2 Rajab, 212 Hijra. Imam al-Hadi (as) like his father Jawad(as) was ordered by the ruler at his time, Abbasid ruler AlMu’tasim, to go in debate with great scholars such as al-Junaydi. The Imam(as) has showed a great knowledge of the Quran and the revelations within. Where even his debater confessed that this great knowledge within the Imam(as) could only be by divine causes.
The Imam(as) is martyred at age of 34 and buried in Samarra, Iraq
Imam Hassan ibn Ali – Askari(as): was born on 8th Rabi’ al awwal 232 Hijra. The Imam(as) was continuously confined to house arrest by the ruler of that time. He(as) was known by his knowledge and despite all the pressure and oppression in his life, he did teach many students about Islam and Quran explanations. The Imam has prepared the nation for the last Imam who will come after him, who would have a distinguishing role from the previous Imams.
The Imam al-Askari(as) died at age of 28 years, and is buried in Samarra, Iraq.
Imam Mohammad ibn Hassan – Mahdi(as): was born in 15th Shaaban 255 Hijra. The Imam Mahdi(as) is the ultimate savior of the humankind. During his blessed life he has passed with two occultation: a minor and a major. The minor occultation have lasted 5 years, where the Imam(as) have prepared the nation for the long one coming after, and he was contacting his followers via specific selected and trusted deputies to support people with the help and answers for disputable issues.
The major occultation started from 941 Hijra and is lasting till nowadays.
Different explanations was given to clarify the reason of the major occultation. As some great scholars explains that the role of the Imam is different from his fathers(as), where his role in not dependent on jurisprudence teaching and clarification, but the He(as) will replace this world with fair and justice after it was filled with injustice and oppression.
But in the same end the main reason of the occultation is hidden from the people and not clarified, we find this as normal as some divine incidents in the past or present are not usually clarified until its occurrence as it could turn in big favor for the believers. This exist in some of the prophets stories, such as the story of Prophet Moses (PBUH) and his instructions regarding the yellow cow ( Quran sura Baqara 67 to 73) as well the Prophet Moses(PBUH) experience with Khidr(PBUH) were many actions were not clarified for him till the end of the test.
Moreoften, Allah(glory for him) instructed believers in Quran to not ask on some information that could weaken their faith instead of maintaining it. “O you who believe, do not ask about matters which, if revealed to you prematurely, would hurt you.” Quran 5:101
Imam Mahdi(as) was mentioned in different hadiths of the Prophet Mohammad(PBUH):
- The world will not perish until a man among the Arabs appears whose name matches my name.
- In the end of the time, my Ummah will undergo very hard affliction like never before, so that man cannot find any way out. Then Allah will appear a person from my progeny, Ahlul-Bayt, who will fill the earth with justice as it was filled with injustice. The inhabitants of the earth and the inhabitants of the heaven love him. The sky will bring down its water everywhere and the earth will bring all what it can offer and will become green all over.[11 ]
- Mahdi from my family will bring about a revolution and will fill the world with justice and equity before which it was filled up with injustuce and inequity.[12 ]
The Imam(as) analogy is not a unique thought for a specific school or religion, it does exist in different religions and philosophical views. The Prophet Mohammad (PBUH) have informed the Muslims that when Imam Mahdi(as) appears all the nations will follow him toward the main humanity goals, and so Prophet Jesus(PBUH) will reappear (after his elevation) to support the Imam(as) toward this great purpose which is the aim of every Prophet that was sent to this humanity.
The Imam(as) will establish justice and peace for all the inhabitant of the earth, and this will happen with the support of the people and the believers who foresee his great intentions to this world. Thence, everyone is asked to prepare for this great event which will give each one of us the right and justice to live in a peaceful life with no oppression or evil work.
For more reading on this subject refer to book “An Inquiry concerning Al-Mahdi” by Muhammad Baqir As-Sadr. 
- Maqtal al-Husayn of Khwarazmi
- Jami Tirmidhi in Merits of Al-Hassan and Hussain, Hadith No.3708
- Sunni reference: Sahih Tirmidhi, V9, P74
- Al-Sahih fi al-Hadith, by al-Hakim. Al-Sawaiq al-Muhriqah, by Ibn Hajar al-Haythami, Ch. 11, section 1, p250
- Musnad Ahmad Ibn Hanbal, V1, P842. Jamius Sagheer, by al-Suyuti, PP 2,1603. al-Urful Vardi, by al-Suyuti, P24. Kanzul Ummal, V7 P186