If he ate and did not rinse out his mouth, then he got up to pray, is his prayer valid?
Question

I had wudu’ and I ate some sweets, then I got up to pray and I did not rinse my mouth. It is my prayer valid?
Praise be to Allah.It is recommended or the one who wants to pray to remove what may remain of the traces or smell of food. Hence it is prescribed to use the siwak when getting up to pray.
If a person does not do that, nothing is required of him and his prayer is valid.
Ahmad (2541) narrated that Ibn ‘Abbas (may Allah be pleased with him) said: I saw the Messenger of Allah (blessings and peace of Allah be upon him) eat meat from a sheep bone, then he prayed and he did not rinse out his mouth or do wudu’. Classed as saheeh by al-Albani in as-Sahihah (3028).
Abu Dawud (197) narrated from Anas (may Allah be pleased with him) that the Messenger of Allah (blessings and peace of Allah be upon him) drank some milk, and he did not rinse his mouth or do wudu’, and he prayed. Classed as hasan by al-Albani in Sahih Abi Dawud.
It says in ‘Awn al-Ma‘bud:
This indicates that rinsing the mouth after drinking milk or eating other things that are somewhat greasy is not necessary; rather it is optional. End quote.
Shaykh Ibn Baz (may Allah have mercy on him) was asked:
Sometimes the time for the obligatory prayer comes when I have wudu’, but I have eaten something and there may be some traces of it left on my teeth. Is it obligatory to rinse my mouth and remove it, or not?
He replied: Rinsing the mouth is recommended to remove traces of food, but with regard to prayer, it does not matter if a little of that is left on your teeth. But if what was eaten was camel meat, then it is essential to do wudu’ before praying, because eating camel meat invalidates wudu’."(Majmu‘ Fatawa Ibn Baz  29/52).
And Allah knows best.