Does Thinking about Breaking Your Fast Break It?
Question

I fasted Ramadan, but during the day I got tired and wondered whether to break the fast or not, then I completed my fast. Does this wavering affect my fast?
Praise be to Allah.Ruling on thinking about breaking the fast
If a person intends to break the fast whilst he is fasting, his fast is invalidated, if he decided to do so and there was no hesitation. If he changed his intention after that, then he has broken the fast and he has to make up that day. 
Ruling on thinking about breaking the fast and being hesitant 
But if a person is hesitant about breaking the fast and has not decided yet, is his fast invalidated by that? 
The scholars (may Allah have mercy on them) differed concerning the issue of thinking about it and being hesitant, and whether that invalidates the fast or not. 
Al-Mirdawi (may Allah have mercy on him) said: 
“According to our madhhab, if a person is thinking about breaking the fast but is hesitant about doing so, or he decided to break the fast after a while, or he says ‘If I find food I will eat, otherwise I will complete the fast,’ this is like the difference of opinion concerning the prayer. 
It was said that this invalidates the fast, because he was not firm in his intention. al-Athram narrated that this is not acceptable in the case of an obligatory fast, unless he is firmly resolved to fast the entire day. 
I say: This is the correct view. 
It was also said that it does not invalidate the fast, because he did not firmly intend to break the fast, and making a conditional intention is not valid.” (Al-Insaf, 3/297) 
The Hanafis and Shafi`is are of the view that his fast is not invalidated by thinking about breaking it but being hesitant. (See: Badai‘ as-Sanai‘ by al-Kasani (2/92) 
An-Nawawi said: 
“The fasting person is hesitant about breaking the fast and is thinking about giving it up, the correct view – which is that of the majority – is that that does not invalidate the fast.” (Al-Majmu‘ Sharh al-Muhadhdhab, 6/297) 
This view is more likely to be correct, because the basic principle is that the fast remains valid and thinking about breaking the fast does not cancel out the intention of fasting, unless the person decides and is firmly resolved to break the fast. 
This view was mentioned in fatwas issued by Shaykh Ibn ‘Uthaymin and Shaykh Ibn Jibrin (may Allah have mercy on them both). 
Shaykh Ibn ‘Uthaymin (may Allah have mercy on him) was asked: if a person does not decide and firmly resolve (to break the fast), rather he wavers, this is a matter concerning which the scholars differed. Some of them said that his fast is invalidated, because hesitation is contrary to firm resolve. 
Others said that his fast is not invalidated, because the basic principle is that the intention remains valid unless he decides and firmly resolves to do something different. This view is more likely to be correct in my opinion, because of its strength. And Allah knows best.” (Majmu‘ al-Fatawa, 19/188)
Shaykh Ibn Jibrin (may Allah have mercy on him) was asked: If a person is fasting, then he wavers between breaking the fast or not, is he regarded as having broken the fast? 
He replied: 
“The scholars stated that if a person decides to break the fast, even if he does not eat, his fast becomes invalid. If a person travels and decides that he will not fast, but he cannot find water or food, and when he does not find them he completes his fast, we say that his fast is invalid because of his decision and resolve (not to fast). 
But with regard to wavering, the basic principle is that the fast remains valid. If there was no firm decision to break the fast , rather he wavered between completing the fast or breaking it, then the basic principle is that it remains valid and is not affected by this wavering, in sha Allah. So his fast remains valid and he does not have to make it up in this case.” (Sharh ‘Umdat al-Ahkam, 38/27) 
Thus it is clear that if a person wavers in his intention of fasting , his fast remains valid because the basic principle is that the fast remains valid. 
And Allah knows best.