Answer
(Fatwa: 1413/1328=D/1429)
You should perform salah behind such an Imam who is pious, aware of Islamic rulings, reciting the Holy Quran with tajweed and holding right Islamic beliefs. If the Imam mentioned in the question has beliefs of shirk, you should avoid offering salah behind him, if he does not have beliefs of shirk but only he is innovator in the religion, then also you should avoid. You should try to perform salah behind a good Imam, but it is better to offer salah behind innovator Imam instead of performing alone. It is impermissible to miss jamat, however if you are doubtful then you had better re-perform the salah.
Allah (Subhana Wa Ta’ala) knows Best
Darul Ifta,
Darul Uloom Deoband