The primary sense of the word is  'foremost' hence (Guide); (Leader in Religion); (Leader in Congregational Prayer); (Role Model)

2:122        O Children of Israel! call to mind the special favor which I bestowed upon you and that I preferred you to all others (for my message)123 Then guard yourselves against a day when one soul shall not avail another nor shall compensation be accepted from her nor shall intercession profit her nor shall anyone be helped (from outside).

    124        And remember that Abraham was tried by his Lord with certain commands which he fulfilled; He said: "I will make thee an Imam to the nations." He pleaded: "And also (Imams) from my offspring!"  He answered: "But my promise is not within the reach of evil-doers."

11:17        Can they be (like) those who accept a Clear (Sign) from their Lord and whom a witness from Himself doth teach as did the Book of Moses before it a guide [imama] and a mercy? They believe therein; but those of the Sects that reject it the Fire will be their promised meeting place. Be not then in doubt thereon: for it is the Truth from thy Lord: yet many among men do not believe!

25:74 And those who pray "Our Lord! grant unto us wives and offspring who will be the comfort of our eyes and give us (the grace) to lead the righteous [imaman]"

36:12 Verily We shall give life to the dead and We record that which they sent before and that which they leave behind and of all things have We taken account in a clear Book (of evidence) [imami moubeen].

       The Imam's function is hence to guide his followers by clarifying and explaining Allah's law, to lead the community in prayer acting as their conductor and may also deliver the Khutba (Sermon) on Friday.

        Neither the Quran nor Muhammad allowed for a PRIESTHOOD. The Imams, according to Shi'a theology, are directly inspired byAllah so that they can guide their followers at all times and that they were designated by Allah at the time of creation.

       Imams were and are identical in their function and position as the Rabbis of the Jews whom they slavishly  emulate almost completely even regarding their unshaven heads and beards and the wearing of  scull-caps, except that the Rabbis are learned lay theologians.

        Originally it was Muhammad who played this role, as an inspired leader to whom 'revelation' was also given.        
Sahih Al-Bukhari HadithHadith 5.175        Narrated byQais bin Abi Hazim
Abu Bakr went to a lady from the Ahmas tribe called Zainab bint Al-Muhajir and found that she refused to speak. He asked, "Why does she not speak?" The people said, "She has intended to perform Hajj without speaking." He said to her, "Speak, for it is illegal not to speak, as it is an action of the pre-Islamic period of ignorance. So she spoke and said, "Who are you?" He said, "A man from the emigrants." She asked, "Which emigrants?" He replied, "From Quraish." She asked, "From what branch of Quraish are you?" He said, "You ask too many questions; I am Abu Bakr." She said, "How long shall we enjoy this good order (i.e. Islamic religion) which Allah has brought after the period of ignorance?" He said, "You will enjoy it as long as your Imams keep on abiding by its rules and regulations." She asked, "What are the Imams?" He said, "Were there not heads and chiefs of your nation who used to order the people and they used to obey them?" She said, "Yes." He said, "So they (i.e. the Imams) are those whom I meant."

Sahih Al-Bukhari HadithHadith 5.452        Narrated bySahl bin Abi Hathma
(describing the Fear prayer): The Imam stands up facing the Qibla and one batch of them (i.e. the army) (out of the two) prays along with him and the other batch faces the enemy. The Imam offers one Rak'a with the first batch they themselves stand up alone and offer one bowing and two prostrations while they are still in their place, and then go away to relieve the second batch, and the second batch comes (and takes the place of the first batch in the prayer behind the Imam) and he offers the second Rak'a with them. So he completes his two Rak'at and then the second batch bows and prostrates two prostrations (i.e. completes their second Rak'a and thus all complete their prayer).

Sahih Al-Bukhari HadithHadith 6.59        Narrated byNafi
Whenever 'Abdullah bin 'Umar was asked about Salat-al-Khauf (i.e. prayer of fear) he said, "TheImam comes forward with a group of people and leads them in a one Rak'a prayer while another group from them who has not prayed yet, stays between the praying group and the enemy. When those who are with the Imam have finished their one Rak'a, they retreat and take the positions of those who have not prayed but they will not finish their prayers with Taslim. Those who have not prayed, come forward to offer a Rak'a with the Imam (while the first group covers them from the enemy). Then the Imam, having offered two Rakat, finishes his prayer. Then each member of the two groups offer the second Rak'a alone after the Imam has finished his prayer. Thus each one of the two groups will have offered two Rakat. But if the fear is too great, they can pray standing on their feet or riding on their mounts, facing the Qibla or not." Nafi added: I do not think that 'Abdullah bin 'Umar narrated this except from Allah's Apostle. (See Hadith No. 451, Vol 5 to know exactly "The Fear Prayer.")

Sahih Al-Bukhari HadithHadith 8.411        Narrated byAbu Huraira
The Prophet said, "When the Imam says 'Amin', then you should all say 'Amin', for the angels say 'Amin' at that time, and he whose 'Amin' coincides with the 'Amin' of the angels, all his past sins will be forgiven."

Sahih Al-Bukhari HadithHadith 7.562        Narrated byAisha
During the ailment of the Prophet some people came to visit him. He led them in prayer while sitting, but they prayed standing, so he waved to them to sit down. When he had finished the prayer, he said, "An Imam is to be followed, so when he bows, you should bow. and when he raises his head, you should raise yours, and if he prays sitting. you should pray sitting." Abu Abdullah said Al-Humaidi said, (The order of )
"This narration has been abrogated by the last action of the Prophet as he led the prayer sitting, while the people prayed standing behind him."

Sahih Al-Bukhari HadithHadith 9.252        Narrated byAbdullah bin Umar
Allah's Apostle said, "Surely! Everyone of you is a guardian and is responsible for his charges: The Imam (ruler) of the people is a guardian and is responsible for his subjects; a man is the guardian of his family (household) and is responsible for his subjects; a woman is the guardian of her husband's home and of his children and is responsible for them; and the slave of a man is a guardian of his master's property and is responsible for it. Surely, everyone of you is a guardian and responsible for his charges."

Al-Tirmidhi HadithHadith 1397        Narrated byAbdullah ibn Abbas
Allah's Messenger (peace be upon him) said, "If anyone speaks on Friday while the Imam is preaching, he is like an ass which carries books, and he who tells him to be quiet is not credited with the Friday prayer."
Ahmad transmitted it.

Al-Tirmidhi HadithHadith 3704        Narrated byAbuSa'id
Allah's Messenger (peace be upon him) said, "The one who will be dearest to Allah and nearest to Him in station on the Day of Resurrection will be a just Imam, and the one who will be most hateful to Allah on the Day of Resurrection and will receive the severest punishment (or as one version says, will be farthest from Him in station) will be a tyrannical Imam."
Tirmidhi transmitted it, saying this is a hasan gharib tradition.

Sunan of Abu-DawoodHadith 581        Narrated bySulamah daughter of al-Hurr
I heard the Apostle of Allah (peace be upon him) say: One of the signs of the Last Hour will be that people in a mosque will refuse to act asImam and will not find anImamto lead them in prayer.

Sunan of Abu-DawoodHadith 604        Narrated byAbuHurayrah
The Prophet (peace be upon him) said: TheImam is appointed only to be followed. This version adds: When he recites (the Qur'an), keep silent."

Sahih Muslim HadithHadith 857        Narrated byAnas ibn Malik
The Messenger of Allah (peace be upon him) one day led us in the prayer, and when he completed the prayer he turned his face towards us and said: O people, I am yourImam so do not precede me in bowing and prostration and in standing and turning (faces, i.e. in pronouncing salutation), for I see you in front of me and behind me, and then said:
By Him in Whose hand is the life of Muhammad, if you could see what I see, you would have laughed little and wept much more.
They said: What did you see, Messenger of Allah?
He replied: (I saw) Paradise and Hell.

Sahih Muslim HadithHadith 946        Narrated byUthman ibn Abul'As ath-Thaqafi
The Apostle of Allah (peace be upon him) said to him: Lead your people in prayer. I said: Messenger of Allah, I perceive something (disturbing) in my soul. He (the Prophet) asked me to draw near him and making me sit down in front of him he placed his hand on my breast between my nipples, and then, telling me to turn round, he placed it on my back between my shoulders. He then said: Act as an Imam for your people. He who acts asImam of the people, he must be brief, for among them are the aged, among them are the sick, among them are the weak and among them are the people who have business to attend. But when any of you prays alone, he may pray as he likes.

Sahih Muslim HadithHadith 1420        Narrated byAbuMas'ud al-Ansari
Allah's Messenger (peace be upon him) said: The one who is most versed in Allah's Book should act asImam for the people, but if they are equally versed in reciting it, then the one who has most knowledge regarding Sunnah; if they are equal regarding the Sunnah, then the earliest one to emigrate; if they emigrated at the same time, then the earliest one to embrace Islam. No man must lead another in prayer where (the latter) has authority, or sit in his place of honour in his house, without his permission. Ashajj in his narration used the word "age" in place of "Islam"