All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
The word “fasting” means “to abstain”. But in Islamic terminology, it means a special abstention from special things during special times. In simple words, it signifies abstaining from food, drink and sexual intercourse for the dim beginning of dawn till sunset. While fasting, the Muslim should make sure that nothing gets into his stomach. The Prophet said: “Exaggerate when rinsing your nose unless you are fasting.” [Abu Daawood, At-Tirmithi, Ibn Maajah and An-Nasaa'i].” Exaggerate when rinsing, which means inhaling water though the nose, is likable for the non-fasting Muslims.
But for the fasting person, this exaggeration when rinsing might lead to some of the water getting into his stomach. As for the toothpaste, it is better to leave it during fasting in order to avoid that anything gets into one’s stomach; above all, if we know that some kinds of it break into pieces which are difficult to manage. But if the fasting person has real need to use it, he could do so, making sure that nothing gets into his stomach. There is no objection as regards having its taste on one’s tongue, as the woman could taste the food while fasting if she needs to do so. But if there is no need to do so, it is not likable to use it.
Allah knows best.