If one takes a vow to fast on a certain day, and he then forgets and eats, he should still complete the fast. This applies to dream fasts, public fasts, or days that he knows to fast on like the day that his father or rabbi died. But if he vows to fast one or two days, and he forgets and eats a kezayit, he has "lost" his fast, and he must fast another day. (Rem"a: There are those who are stringent, saying that when he vowed to fast on a specific day, he is obligated to finish the fast but still must be stringent and fast another day (Trumat Hadeshen chapter 156)).
If one vows to fast for ten days, starting whenever he wants, and he was fasting on one of the days and needed to break the fast for a mitzvah or to honor a great man (Rem"a: or if he is in pain -Tur) he can "borrow and repay" his fast some other day, because the specific days were not set at the time of the vow. However, if he did not accept upon himself to fast some day and instead, in the afternoon prayer, he accepted a fast tomorrow, we think of this as "that fast," and he cannot borrow. Rem"a: This applies even more when he references an explicit day, i.e. if he says at the time of the vow, "I will fast on day x" or "I will fast on Monday and Thursday all year" or similar things (Trumat Hadeshen chapter 275 and Kol Bo). [End of Rem"a] He similarly cannot borrow if it is a fast for a dream. Rem"a: This applies even more to public fasts (Trumat Hadeshen chapter 156 and Kol Bo and Rabbeinu Yerucham). However, for the Monday-Thursday-Monday fasts that are done after Passover and Sukkot or even for the ten days of repentance, if a circumcision occurs, it is a mitzvah to eat and he need not dissolve the vow, as it is not the custom to fast in these circumstances. This only applies if the meal is there; however, if they send food to his home [following the festivity], he cannot eat. And [in such circumstances], if he accepted the fast in [yesterday's] afternoon prayer, he must fast. (Hagahot Maimoni chapter 1). There are those who say that if he is in great pain, he can redeem himself through payment, which is the rule for other cases of duress (the Ros"h in the name of the Raava"d and Rabbeinu Yerucham 55:1). This only applies when he accepted a fast; however, if he fasted it by way of a vow, he must fulfill his vow.
One who vows to fast a certain number of fasts can push them off until the winter (Rem"a: and can borrow a long day and pay back with a short day, because each one is considered a day (Piskei Mahara"i siman 60 and Hagahot Mordechai)).
There is one who says that fasting for two days and two nights consecutively is equal to four non-consecutive fasts. Rem"a: There are those who say that for a weak person, two consecutive consecutive days if sufficient, but for a healthy person, three is necessary (Mahar"i Brynn's notes on customs). It seems to me that all of this applies only to somebody who must fast for forty non-consecutive days for repentance in order to cause himself pain. In those cases, we equate this pain to that pain, and that is why the later authorities discuss this. However, somebody who vows to fast forty days must fulfill his vow, because it isn't any weaker than saying "this day," where he cannot borrow and repay. Even those who hold that when he says "this day," he can borrow and repay, would concede here that he must fulfill his vow. This applies even more to the forty days before Yom Kippur when people fast in remembrance of Moses's ascent of the Mountain [Sinai]. One who has accepted these cannot repay them with two or three consecutive days.
One who fasts for a dream on a festival, Hol Hamoed, Rosh Hodesh, Hanukah, Purim, the day before Yom Kippur must fast [to repent] for his fast, just like one who fasts for a dream on Shabbat (and see above 288:4).
Public fasts in Babylonia are not observed in such a way as to prohibit work or to stop eating when it is still light. Only the Ninth of Av is observed this way. Therefore, if an individual accepts upon himself a fast, we do not worry that it is a public fast and he is permitted to do all of this. That said, it is best for him, at the time of the acceptance of the fast, to say "I will be in an individual fast before You tomorrow."
If the day that his father or mother died falls in Adar and the year is a leap year, he should fast in the second Adar. Rem"a: There are those who say that he should fast in the first [Adar] (Mahari"l and Mahar"i Mintz) unless [the parent] died in a leap year in the second Adar, in which case the practice is to fast in the second Adar (Trumat Hadeshen siman 295). It is the practice to fast in the first [Adar]. However, there are those who are stringent and fast in both (the rulings of Mahar"i in the name of Mahar"i Molin).
It is only necessary to fast on the day that one's father died and not on the day of burial.
If the day of the death of one's father occurs on Shabbat or Rosh Hodesh, [the fast] should be pushed to the following day. Rem"a: The practice is not this way. Rather, we do not fast at all. This is also true of other days that we do not say Tahanun on.
If one vowed to visit the graves of righteous people in some location, and he was delayed for a long time and later it happened that he was hired to go there, that trip counts.
If one vowed to fast for a set number of consecutive days and an obligatory fast occurred within that set of days, it counts.
One who is fasting, whether for his troubles or his dreams or whether he is fasting with the community for their troubles, he should not experience pleasure, nor should he act lightheartedly, nor should he be happy or in good moods. Rather, he should worry and mourn, following what is written "Of what should a living man complain?" ([Lamentations 3:39]).