We are human beings and to err is human. Although we pray prayer with full care and attention yet sometimes we err. Rather even when we do not err on some occasions we do begin to doubt about the performance of a particular part of the prayer. And there is every likelihood that we might have erred. Now when anybody doubts about certain performance of prayer, he should ponder for a moment to shake of his doubt but if he fails to satisfy himself then he should act according to the prescribed rules.
There are 23 cases of doubt that may arise during prayer. The laws of Shari'ah are distinct for each one of these.
Six cases of doubts are such that these can be ignored. Prayer does not become invalid in the event of these doubts.
1. Doubts after having finished the prayer.
2. Doubt after passing of the event. For example while in sajdah, to doubt having missed ruku’.
3. Doubt after the time has passed. For example, doubt at the time of Maghrib whether the ‘Asr prayer was offered or not.
4. People having doubtful natures. Such persons doubt about everything. So they can be doubtful about prayer also. They must ignore their doubts.
5. Doubt either by an Imam (one who leads the prayer) or a ma’mum (the follower of the Imam in prayer). In this case the Imam may be sure of his performance but the ma’mum is doubtful or vice versa. In such case whoever is in doubt will follow the one who is sure.
6. Doubt during a sunnat (non-obligatory) prayer, or in Salat al-ihtiyat.