Shia Muslims prove the infallibility of their Imams (peace be upon them) in various ways; some are logical, and others are from the Holy Quran and the traditions of the Prophet (peace be upon him and his holy progeny). The books of beliefs state these proofs clearly. Many narrations from Sunni and Shia books of traditions mention that the Imams are twelve, without mentioning their names. Many narrations in the Shia books of traditions mention the names of the Imams (peace be upon them).
It is compulsory to follow the most knowledgeable amongst those who have reached the level of ijtihad, and it is not sufficient to follow any mujtahid.