كتاب الحيض
3
The Book of Menstruation
(26)
Chapter: Evidence that if a person is certain that he is in a state of purity, then he doubts whether he has committed hadith (broken his wudu’), then he prays with his purity like that
(26)
باب الدَّلِيلِ عَلَى أَنَّ مَنْ تَيَقَّنَ الطَّهَارَةَ ثُمَّ شَكَّ فِي الْحَدَثِ فَلَهُ أَنْ يُصَلِّيَ بِطَهَارَتِهِ تِلْكَ

Abu Huraira reported:

The Messenger of Allah (ﷺ) said: If any one of you has pain in his abdomen, but is doubtful whether or not anything has issued from him, be should not leave the mosque unless he hears a sound or perceives a smell.
وَحَدَّثَنِي زُهَيْرُ بْنُ حَرْبٍ، حَدَّثَنَا جَرِيرٌ، عَنْ سُهَيْلٍ، عَنْ أَبِيهِ، عَنْ أَبِي هُرَيْرَةَ، قَالَ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏ "‏ إِذَا وَجَدَ أَحَدُكُمْ فِي بَطْنِهِ شَيْئًا فَأَشْكَلَ عَلَيْهِ أَخَرَجَ مِنْهُ شَىْءٌ أَمْ لاَ فَلاَ يَخْرُجَنَّ مِنَ الْمَسْجِدِ حَتَّى يَسْمَعَ صَوْتًا أَوْ يَجِدَ رِيحًا ‏"‏ ‏.‏
Reference : Sahih Muslim 362
In-book reference : Book 3, Hadith 126
USC-MSA web (English) reference : Book 3, Hadith 703
  (deprecated numbering scheme)