This entire halacha is derived from an early
Rishon (The Mordecai - 1240-1298) and not from any Gemara.
We have learned that the woman needs to count seven days. What
happens when she believes, erroneously, that she has seen a stain that
would make her impure? In that case we rule that the woman has had
what we call a "hesech hada'as" - an interruption in her intent
and she therefore needs to recount the seven days.
The Rama advises us that there is no attribution
during the first 3 days. Quoting the Tzemach Tzedek
(1789-1866, the 3rd Lubavtich Rebbe), the Toras HaShlamim
teaches that the period meant here is not the first 3 days of the 7
clean days, but rather is the first three days on which there is no
bleeding. Therefore, if a woman's menstruation lasted for 3 days,
then days 4 and 5 of her initial 5 day impurity would count as days 1
and 2 of the 3 days referred to here. Obviously, this means that a
woman would need to have done a self-examination during those days.
There is an argument between the Tzemach Tzedek and his
son-in-law, the Avodas HaGershuni in a case revolving around a
woman whose menstruation began on an Wednesday. On Friday the
woman performed a basic self-examination to see if she could wear white
clothing for Shabbos. Based on the exam, Avodas HaGershuni
permitted the woman to start counting the 3 days at that time while his
father-in-law demurred, stating that any self-examination prior to the 7
clean days must be known to have been as thorough as the self exams of
the 7 days themselves. He does not, however, argue about the
concept of starting the 3 days during the initial 5 days. It seems
that most poskim follow the more lenient view. My own
opinion is that since we normally don't do self-examinations to
determine our wardrobe selections, one might as well perform a
self-examination as thorough as that for the 7 clean days, since the
self-examination has no other purpose than to initiate the 3 day count.
There is a dispute among the poskim about another
aspect of the 3 day requirement, based on the word in the halacha "legamre".
One view requires that she actually do a self-examination on the 3 days
in question. However, the basic meaning of the Rama is
exactly as it sounds - that the determining factor is the passage of
days and not self-examinations.
If a woman finds a stain on a garment that she wore on both
Day 3 and Day 4 and does not know whether the stain was there from Day
3, we rule leniently and attribute the stain to Day 4, at which point
the normal rules of staining apply.
Rav Wozner suggests that we be strict regarding colored
garments on the first three days and include stains on colored
undergarments that are next to the skin in the category of staining that
would render her impure. The Chasam Sofer disagrees and
applies the exemption of colored garments to the first three days as
well.