The imam in my village is a smoker. Is it permissible for me to follow him for prayer? Is my prayer valid? Or is it better if I pray on my own?
According to the 37th National Muzakarah Fatwa Committee for Religious Affairs Malaysia on 23rd March 1995, the Muzakarah has decided that smoking is prohibited according to Islam. Among the criteria of an imam is as stated in a narration from Abu Mas’ud al-Ansari, where Rasullullah PBUH said:
يَؤُمُّ الْقَوْمَ أَقْرَؤُهُمْ لِكِتَابِ اللَّهِ فَإِنْ كَانُوا فِي الْقِرَاءَةِ سَوَاءً فَأَعْلَمُهُمْ بِالسُّنَّةِ فَإِنْ كَانُوا فِي السُّنَّةِ سَوَاءً فَأَقْدَمُهُمْ هِجْرَةً فَإِنْ كَانُوا فِي الْهِجْرَةِ سَوَاءً فَأَقْدَمُهُمْ سِلْمًا
“The one who knows [by recitation and memorization] the Book of Allah most should be the Imam of the people. If they are equal in the recitation, then the one who knows the Sunnah most and if they are equal in the Sunnah then the earliest of them to emigrate (to al-Madinah) and if they are equal in the emigration then the oldest among them in Islam.” 
Whereas in a hadith narrated by Imam al-Tirmizi, the Prophet PBUH said:
“The one who is oldest “agewise” 
The individual who is the best in terms of his proficiency in the Qur’an also means the one who memorized the most of the Qur’an or with the best recitation of the Qur’an. The supporting evidence that it means who memorized the most is based on the hadith narrated by Abdullah Ibn Umar, he said:
لَمَّا قَدِمَ الْمُهَاجِرُونَ الْأَوَّلُونَ الْعُصْبَةَ -مَوْضِعٌ بِقُبَاءٍ – قَبْلَ مَقْدَمِ رَسُولِ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّم ، كَانَ يَؤُمُّهُمْ سَالِمٌ مَوْلَى أَبِي حُذَيْفَةَ ، وَكَانَ أَكْثَرَهُمْ قُرْآنًا
“When the earliest emigrants came to Al-`Usba – a place in Quba’- before the arrival of the Prophet- Salim, the slave of Abu Hudhaifa, who knew the Qur’an more than the others used to lead them in prayer.” 
Imam al-Nawawi in his commentary on the hadith from Abu Mas’ud al-Ansari added another characteristic that is important for an imam and it is the factor of the person’s warak (character). He said:
ولنا وجه اختاره جماعة من أصحابنا : أن الأورع مقدم على الأفقه والأقرأ لأن مقصود الإمامة يحصل من الأورع أكثر من غيره
“And we have a chosen opinion from a group of our ashab (Syafi’iyyah scholars) who stated that the most warak individual is prioritized over a faqih and one with better proficiency of the Qur’an. The reason is the purpose of an imam is the result of the most warak person compared to others.” 
Meanwhile, among the imam who is makruh to be followed are the people of bidaah and fasiq (they are the people who are known to be committing sins frequently). However, if there is a collision of which is prioritized; praying alone or together with the fasiq or people of bidaah, then here, there is a difference of opinions. Imam Ibn Hajar al-Haitami stated that it is better to pray alone while Imam al-Ramli said praying in congregation with them is prioritized. 
To conclude, an imam shouldn’t be from amongst the smokers even when the ruling of praying following him is valid. This following the fatwa by Imam al-Ramli in the issue of praying following an imam who is a person of bidaah or fasiq, I’m inclined towards the opinion which stated that it is prioritized to pray in congregation with an imam who is a smoker than praying alone. Try your best to advise him to change for the better. Wallahua’lam.