To pray in congregation ("solat berjemaah") in a mosque is not without its challenges. One of the challenges is bad breath coming from our immediate neighbour. If it so happens that our Muslim brother, whose praying besides us, has a bad breath, then the tendency is for us to lose our concentration ("khusyuk") in our "solat".
For this reason, our Prophet (PBUH) had said, "If it is not a burden to my followers, I would have instructed them to "bersugi", that is, to clean their teeth each time before they go for prayer." The hadith was narrated by Abu Hurairah as told from "Riwayat Muslim".
Thus, our Prophet (PBUH) stressed about the importance of having a clean breath when praying.
Another hadith, as narrated by Abdullah bin Abbas, has the Prophet PBUH as having said, "You should perform the "siwak" to clean your mouth to receive pleasures ("keredhaan") from Allah SWT (from Al-Bukhari and Al-Baihaqi).
To perform the "siwak" means to use the young twigs or roots to clean the teeth. At those times, the toothbrush and toothpaste had not been invented yet. So they used twigs or roots to clean their teeth instead.
According to his beloved wife, Aisyah r.ha, the Prophet PBUH always performed the "siwak" everytime he wanted to perform the "solat". During the fasting month of "Ramadhan", she said that he would "siwak" a couple of times during the day. Aisyah r.ha. also said, "The Prophet (PBUH) when he entered the house, would perform the "siwak" first".
One of the Prophet's companions, Jabir bin Abdullah r.a. heard the Prophet (PBUH) as saying, "To perform two "rakaat" with "siwak" beforehand is better than to perform 70 "rakaat" without performing the "siwak" first.
So the next time that we go to the mosque to perform the "solat" in congregation, we should ensure that we brush our teeth and if possible gargle our mouth with "Listerine" too.
Fom my own experience, bad breath happens during the time when performing the "Solat Subuh" and "Solat Ishaq" in congregation in the mosque. In the morning, it happens because we probably don't have the time to brush our teeth before we go to the mosque to perform the "solat" in congregation. As for the "Solat Ishaq", the bad breath was probably due to an early dinner before performing the "Solat Maghrib" at the mosque. Normally an "Ustaz" (Religious Teacher) would give a "ceramah"(religious talk) after peforming the "Solat Maghrib" until it is time to perform the "Solat Ishaq". Due to the long wait during the "ceramah", the bacteria in the mouth have sufficient time to go into action in causing the bad breath to happen.