There is no doubt that in order for Islam to survive, it needs a keeper and guardian and individuals to deliver and express the teachings and guidelines of religion for the people, and carry them out. Since one of the reasons of creation is the guidance of mankind, Allah’s wisdom calls for Him to determine and appoint a leader for the safeguard and protection of religion after the Prophet’s demise, not tp leave them to themselves and their own minds which is usually under the domination of their desires.
Proving the successorship and imamate of Imam Ali (as) can’t be done using logical and intellectual reasoning because only Allah (swt) and His prophet only know who is to succeed him, therefore in order to prove that Imam Ali (as) was true successor to the Prophet (pbuh), we need to refer to Quranic verses and traditions and historical facts and narrations to show that he was the one in mind.
1) Quranic reasoning:
There are many verses that with the help of traditions from Prophet Muhammad (pbuh) which explain them, prove the imamate and successorship of Imam Ali (as). The verses of Tabligh, Ulul-Amr and Seddiqin are some of these verses that we will analyze in the detailed answer.
2) Hadithic reasoning:
There are many traditions that have been narrated from both Shia and Sunni sources that the Prophet of Islam (pbuh) said: “My successor is Ali (as), and after him my two sons, Hasan and Husein (as) (are to take his place) which nine other imams will follow them from the back (progeny) of Husein. Of course, this tradition is one of the many that prove his imamate like the hadith of “Yawmul-Dar”, “Manzilah”, “Ghadir Khum” and the hadith known as the hadith of “Thaqalain”, or like the hadiths that report the Prophet (pbuh) saying that after him, twelve individuals will be khalifah that will cause Islam to be glorious.
There is no doubt that in order for Islam to survive, it is in need of a guardian and protector. It needs qualified, complete and infallible individuals that can deliver the teachings and guidelines of religion to the people and execute its laws. Since one of the purposes of creation is to guide man to the right path, Allah’s wisdom calls for Him to assign and introduce a successor to the Prophet (pbuh) after his demise to be responsible for guiding the people and taking care of religion, not to leave them to their own minds which is usually controlled and under the domination of their personal desires. Therefore, logic and intellect say that infallible imams with Godly knowledge that He has bestowed on them are necessary for all eras in order for religion to survive.
Till now, we were speaking of the necessity of having an imam, not taking into consideration who he is, but proving that Imam Ali (as) himself is the true successor to the Prophet (pbuh), can’t be directly done by intellectual reasoning because revealing exactly who is to succeed him is something that only Allah (swt) and His prophet are aware of. Nevertheless, by using the logical reason mentioned above  , in addition to Quranic and hadithic reasoning and historical facts and narrations, one can prove Imam Ali’s successorship.
Here, we will prove this matter using Quranic verses and traditions.
1) Quranic reasoning:
There are many verses that speak of Imam Ali (as) and the other imams being imam, of course with the help of other mutawatir hadiths (hadiths that have been narrated so much by many different narrators that one can easily become sure that the hadith is authentic) from the Prophet (pbuh) that explain these verses further.  We will point to some of these hadiths that are accepted by both Shias and Sunnis  .
1- “The Verse of Tabligh”: “O Messenger! Proclaim the message that has been sent down to you from your creator and nurturer! And if you do not do so, then you would not have fulfilled your duty (as Allah's messenger). (Know that) Allah will protect you from (the possible dangers of) people. Verily, Allah does not guide the disbelievers.” 
Allah (swt) boldly orders His messenger to fulfill his duty and according to traditions, following the revelation of this verse, in a place named Ghadir Khum, the holy Prophet (pbuh) appointed Imam Ali (as) as his successor using the famous phrase of “whosoever I am his master, Ali is his master after me”. 
2- “The Verse of Wilayah”: “Your waliyy (guardian and religious authority) is only Allah, His Apostle, and the faithful who establish prayer and give charity while bowing down.” 
Many commentators of the Quran have said that this verse has been revealed regarding Imam Ali (as). 
In his tafsir, al-Durrul-Manthur, the Sunni scholar Suyuti, under this verse, says that Ibn Abbas said: “Ali (as) was in ruku’ (bowing in prayer), when a beggar entered and asked for help. His Excellency gave him his ring as charity. The Prophet (pbuh) asked the beggar: “Who granted you this ring?” The beggar pointed to Ali (as) saying: “The man that is bowing in prayer.” It was then that this verse was revealed. 
Fakhr Razi in his tafsir narrates from Abdullah ibn Salam that: “When this verse was revealed, I told the Prophet (pbuh) that I personally saw Ali (as) give his ring in charity to a beggar while bowing in prayer and that is why I accept his wilayah (guardianship and religious authority). He also narrates another hadith similar to this one from Abudhar regarding this verse. 
Tabari also narrates various hadiths on this verse in which most of them say that it has been revealed concerning Ali (as). 
Allamah Amini proves in the book Al-Ghadir that this verse was revealed about Imam Ali (as) using around twenty reliable and authentic Sunni books, citing their exact sources. 
In this verse, the religious authority of Ali (as) has been placed next to the religious authority of Allah (swt) and the holy Prophet (pbuh).
3- “The verse of Ulul-Amr”: “O you who have faith! Obey Allah and obey the apostle and those vested with authority among you.” 
On one hand, scholars have said that this verse has been revealed regarding Imam Ali (as). 
For instance, the famous Hanafi commentator of Neishabour (near Mashhad of Iran), Hakem Haskani has narrated five hadiths under this verse in which all of them, Ulul-Amr has been applied to Ali (as). 
In the tafsir of Al-Bahrul-Muhit of Abu Hayyan al-Andalusi al-Maghribi, when quoting the different viewpoints on who is meant by this term, he quotes Maqatel, Meymoun and Kalbi (three Sunni commentators) all saying that the Ahlul-Bayt are meant by it. 
Abu Bakr ibn Mu’min al-Shirazi of the Sunni scholars narrates in Al-I’tiqad from Ibn Abbas that the abovementioned verse is about Imam Ali (as). 
On the other hand, the obedience of Allah (swt), His apostle and Ulul-Amr have all been made mandatory in the same style and without repeating the word “اطیعوا ” (obey) (meaning that the verse has said: “Obey Allah, His apostle and the Ulul-amr” instead of saying: “Obey Allah, obey His apostle and obey the Ulul-Amr” and this signifies that there is a reason behind not repeating this word because in other instances, the Quran has repeated it). It can be concluded that the Ulul-Amr are required to be infallible (or else there was no reason to order everyone to obey them unconditionally) just like Allah (swt) and His apostle (pbuh) (and that is the reason for not repeating the word “اطیعوا”; to show that the obedience of the three is all of the same type and unconditional) and according to Shia tradition, the infallibles are limited to the imams that the Shias believe in.
What was mentioned was only a small number of the many hadiths that can be found on these three verses of the verses that prove the successorship of the Ahlul-Bayt in Sunni sources that they themselves accept and also in Shia sources. There are other important points concerning these and other verses that can be found in Sunni books, for further information, you can refer to dependable books on this subject.
Other than these three verses which were briefly mentioned, there are other verses such as: “The verse of Sadeqin” (O you who have faith! Be wary of Allah, and be with the truthful)  ` and “The verse of Qurba” (I do not ask you any reward for it other than the love of [my] relatives)  that directly get engaged in the wilayah and successorship of Imam Ali (as) and the other imams. They have been mentioned in Sunni and Shia books.
In addition to these verses, there are other verses that express Imam Ali’s virtues and his superiority to the other friends and companions of the Prophet (pbuh). Now that it has been proven that Imam Ali (as) is superior to the others, one’s unbiased intellect says that the superior one must be chosen over the one who is lower, therefore, it can be concluded that Ali (as) needs to be the true successor to the Prophet (pbuh) not anyone else.
2) Hadithic reasoning:
It has been narrated in numerous Sunni sources from the Prophet (pbuh) saying that Ali ibn Abi-Taleb, and after him, his two children, Hasan and Husein and after them nine imams from the back (progeny) of Husein are to take his place.  There are also many other hadiths such as the hadith of “Yawmul-Dar”, “Manzilah”, “Ghadir Khum” and the one famous as “Thaqalain”, and others that disclose that after the Prophet (pbuh) twelve individuals will come in which will make Islam glorious and of respect.
In order for the discussion to clarify further, we will briefly discuss three hadiths:
1- The hadith of Manzilah:
The background of this hadith is that in the battle of Tabuk, the Prophet (pbuh) left Medinah along with many of his companions to fight the Romans. In order for Medinah not to be left without a leader, he appointed Ali (as) as the one to take his place until his return. Some began to insult Ali (as) saying that the Prophet (pbuh) has left him behind to take care of the women and children there.
Ali (as) complained to the Prophet (pbuh) about what was being said about him. There the Prophet (pbuh) has been quoted making this historical statement: “In comparison with me, you (Ali) are like Prophet Harun (Aron) when compared with Prophet Musa, the only difference (between us and them) being that there is no messenger after me (meaning that for me, you are exactly like how Harun was for Musa, the only difference is that Harun was a prophet but you aren’t).” 
2- The hadith of Thaqalain:
This hadith has been mentioned in many reliable Sunni sources.  The story goes like this: During the final days of his life, the holy prophet of Islam (pbuh) said to his companions: “O people! I will soon be called by my lord and I will answer his call (meaning that his death is getting close). I am leaving behind two valuable and precious things amongst you; one being the book of God Almighty, and the second being my progeny. The book of God is a strong rope which hangs into our world from the heavens, and my progeny is my household. These two will never be separated from each other till they come to me next to the pool of Kawthar (in paradise). So be careful and see how you treat the two after me.” 
3- The hadith of Ghadir:
The event of Ghadir took place in the last year of the Prophet’s (pbuh) life after the final Hajj that his Excellency performed. There he said: “…Whosoever I am his master and leader (mawla), Ali is his master and leader after me…” thus explicitly announcing the successorship and authority of Ali (as) after him and as a result, fulfilling his duty.
This incident has been reported by a great number of the sahabah (companions of the Prophet [pbuh]) (110 individuals)  , 84 individuals from the tabe’in (those who weren’t immediate companions of the Prophet (pbuh) and never saw him, yet they experienced the era of his companions), and 36 scholars and researchers. Using concrete evidence and reasoning from famous Shia and Sunni sources, Allamah Amini has mentioned all of these narrations and quotes in his book Al-Ghadir.
What was mentioned here was a small portion of the many reasons for Imam Ali (as) being the true and immediate successor to the Prophet (pbuh). 
For further information, see:
- Tafsire Payame Quran (under the supervision of Ayatullah Makarem Shirazi), vol. 9, pg.177 and on.
 For further information, see indexes:
1- Logical reasoning on Imamate, Question 671.
2- Logical reasoning on Imam Mahdi (as), Question 581 (website: 634).
 In order to see why the imams’ names haven’t clearly been stated in the Quran, see index: The names of the imams in the Quran.
 For further information see index: The reasons for believing in the imams and imamate itself.
 یا ایها الرسول بلغ ما انزل الیک من ربک... Maidah:67. For further information, see index: The Sunnis and the verse of Tabligh.
 Makarem Shirazi, Payame Quran, vol. 9, chapter: Imamate in the Quran, pg. 182 and on.
 انما ولیکم الله و رسوله و الذین امنوا الذین یقیمون الصلاة... Maidah:55.
 Because according to hadiths, the one who gave his ring in charity to the beggar was none other than Imam Ali (as).
 Al-Durrul-Manthur, vol. 2, pg. 293.
 Asbabul-Nuzul, pg. 148.
 Tafsir of Kashaf, vol. 1, pg. 649.
 Tafsir of Fakhr Razi, vol. 12, pg. 26.
 Tafsir of Tabari, vol. 6, pg. 186.
 Al-Ghadir, vol. 2, pg. 52 and 53.
 یا ایها الذین امنوا اطیعوا الله و اطیعوا الرسول و اولی الامر منکم... Nisa:59.
 There are also tens of hadiths in the tafsir of Burhan under this verse that say that the abovementioned verse was revealed regarding Imam Ali (as) and the other imams of the Ahlul-Bayt. In some hadiths the names of the other eleven imams have even been mentioned one by one. Tafsir Burhan, vol. 1, pg. 381-387.
 Shawahidul-Tanzil, vol. 1, pg. 148-151.
 Bahrul-Muhit, vol. 3, pg. 278.
 Ihqaqul-Haqq, vol. 3, pg. 425.
 یا ایها الذین امنوا اتقوا الله و کونوا مع الصادقین Tawbah:119. It has been stated in traditions that Imam Ali (as) and the Prophet’s household are meant by “The Truthful”. (Yanabi’ul-Mawaddah, pg. 115 and Shawahedul-Tanzil, vol. 1, pg. 262)
 Shura:23. For further information see index: The Ahlul-Bayt and the verse of Mawaddah (affection).
Sibt ibn Jawzi, Tadhkiratul-Khawass,printed in
 انت منی بمنزلة هارون من موسی الا أنه لا نبی بعدی Fadha’ilul-Khamsah, vol. 1, pg. 299-316.
 Sahih Muslim, Sahih Tirmidi , vol. 2, pg. 308; Khasa’es Nisa’i, pg. 21, Mustadrak Hakem, vol. 3, pg. 109; Musnad Ahmad ibn Hanbal, vol. 3, pg. 17.
 انی اوشک ان ادعی فاجیب و انی تارک فیکم الثقلین کتاب الله عز و جل و عترتی. کتاب الله حبل ممدود من السماء الی الارض و عترتی اهل بیتی، انهما لن یفترقا حتی یردا علی الحوض فانظرونی بم تخلفونی فیهما Fadha’ilul-Khamsah, vol. 2, pg. 44-53.
 Zayd ibn Arqam, Jabir ibn Abdillah Ansari, Ibn Abbas, Abu Sa’id, Bara’ ibn Azeb, Hudhaifah, Abu Hurairah, Ibn Masoud, Amer ibn Leila are some of those sahabah.
 For further information see the precious book of Al-Ghadir, work of Allamah Amini, vol. 1 and the book Pishvayee az nazare Eslam of Ayatullah Subhani pp. 274 and 317 which are specifically for the analysis of the hadith of Ghadir.