All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
The books of Al-Bukhari and Muslim are the most authentic books after the Book of Allaah, and the entire Muslim nation accepted the narrations reported by them, except very few narrations which some late scholars criticized. However, Al-Bukhari and Muslim were correct about most of these criticized narrations, as stated by Ibn Hajar and others. For more benefit, please refer to Fatwa 87578.
It is not a problem for these two books to contain few weak narrations, and for some scholars to criticize (based on the scientific principles) some of the narrations reported by them, as it is only the Book of Allaah which is infallible. However, the problem is rejecting some authentic narrations reported by Al-Bukhari and Muslim or by others baselessly.
As regards the Prophet being illiterate, then this is a matter proven by the Quran and the Sunnah of the Prophet . The narrations which state that the Prophet wrote with his hand are understood by the scholars to mean the following:
1. The narrations could mean attributing the act to the one who ordered the act to be done even if he did not carry out the act himself. This is the view of the scholars who believe that the Prophet remained illiterate and that he could neither read nor write. This group of scholars did not classify the authentic narrations as weak just out of some contradictions which might appear.
2. The narrations could mean that the Prophet really wrote with his hand. Some scholars are of this view and they consider that this is one of his miracles. They said that he was illiterate and then Allaah taught him the knowledge which he did not know, and made him read that which he could not read, and recite that which he could not recite. Similarly, after he was commissioned as a Prophet, Allaah The Almighty could have taught him to write with his hand what he could not write beforehand. They [scholars] said, "Describing him as an illiterate person before his Prophethood does not undermine his status."
The above scientific explanation may clarify the misconceptions about the contradiction between these texts. As regards some enemies of Islam who use some of these texts to challenge Islam, then it is not permissible for us to reject these texts just because of this challenge as they may even cast doubts about some verses of the Quran, are we then going to reject these verses just because they rejected them or shall we look for the answers of the scholars for such a challenge?
Allaah Knows best.