Answer
Fasting is not valid without intention. The Prophet (peace be upon him) said: "Actions are but by intentions," as recorded in Sahih al-Bukhari 1:3, and Sahih Ibn Hibban 2:113. Intention is necessary to distinguish worship from habit.