IMMERSING BEFORE ROSH HASHANAH AND YOM KIPUR [Erev Yom Kipur: Tevilah]
Gemara
Question: May one eat Terumas Chutz la'Aretz after immersing from Tum'as Mes, before nightfall?
Answer (Rav Nachman): (Yes, because) we do not have Mei Chatas nowadays!
(Rav Amram citing Rav): A Tamei Mes may immerse and eat Terumas Chutz la'Aretz immediately.
The Halachah is not like Rav.
(Mar Zutra): One who becomes Tamei through a Sheretz may immerse and eat Terumas Chutz la'Aretz immediately.
The Halachah is not like Mar Zutra.
Rosh Hashanah 16b (R. Yitzchak): One is obligated to become Tahor during the festival - "uv'Nivlasam Lo Tiga'u".
Berachos 22b -Rav Papa (to Rav Huna brei d'Rav Yehoshua and Rava bar Shmuel): I should lead Birkas ha'Mazon, because nine Kabim (about 13-22 liters) of water were poured on me. (Ezra enacted that a Ba'al Keri (one who had a seminal emission) may not learn or pray until he immerses. Nine Kabim permit in place of immersing.)
Rava bar Shmuel: A Beraisa teaches that nine Kabim permit one to learn, but he may not teach or bless for others until immersing in 40 Se'ah! Rather, I should lead, for I immersed in 40 Se'ah.
Rav Huna: I should lead, for I had no need to immerse.
Rav Chama would immerse on Erev Pesach to be Motzi others (in Berachos, or the Hagadah).
The Halachah does not follow him.
Rishonim
Rambam (Hilchos Tum'as Ochlim 16:10): All of Yisrael are commanded to be Tahor on every festival, for they are prepared to enter the Mikdash and eat Kodshim. "Uv'Nivlasam Lo Tiga'u" refers only to Regalim. One who becomes Tamei is not lashed. At others times of the year, one is not commanded.
Rosh (Yoma 8:24): The custom is to immerse on Erev Yom Kipur. Rav Amram Gaon says that one immerses at seven hours, and then prays Minchah. Rav Sadya Gaon says that one blesses after leaving the water. I disagree. There is no hint in the Gemara or Nevi'im to this Tevilah, and it is not a custom from the Nevi'im. It is not better than taking Aravos (on Hoshanah Rabah), which we do not bless on, for it is only a custom from Nevi'im. The Tevilah is not due to R. Yitzchak's teaching, for nowadays we do not have Taharah. The entire year a Ba'al Keri need not immerse. It is not obligatory on Erev Yom Kipur, and one may not bless on it. It is a mere custom to become Tahor from Keri before Yom Kipur. A Midrash (in which angels say that Yisrael are like angels on Yom Kipur) supports the custom.
Gra (OC 606:14): Primarily, the Midrash means that Yisrael are clean from sin. In any case, we try to be as similar to angels as possible.
Rashi (Berachos 22b DH v'Leis): The Halachah does not follow R. Chama. Nine Kabim suffices also for (being Motzi) others. Alternatively, we hold like R. Yehudah ben Beseirah (that one need not immerse at all).
Poskim
Rema (OC 581:4): Some have the custom to immerse on Erev Rosh Hashanah, due to Keri.
Darchei Moshe (4 DH Kasav ha'Kol): Kol Bo says that the custom is to immerse in the river. We do not bless on it. Tashbatz (Katan 122) would pour nine Kabim (the volume of 216 eggs) of hot water on himself in place of Tevilah, since it is only for Taharah. It is not obligatory. The custom is to immerse.
Gra (29): (See) Berachos 22b.
Damesek Eliezer: The Gemara concluded that the Halachah does not follow Rav Chama. Letter of the law, one need not immerse even to be Motzi others. However, since we find that Chachamim were stringent, some have the custom to immerse also on Erev Rosh Hashanah, in order to be clean on Rosh Hashanah like angels, like we say about Erev Yom Kipur.
Magen Avraham (15): Therefore, one should not have relations on Rosh Hashanah. However, if it is Leil Tevilah (the night she immerses from Nidah), he must fulfill Onah (relations at the proper times). He immerses again in the morning. This applies to both nights.
Sha'arei Teshuvah (16): Mor u'Ktzi'ah questioned forbidding relations (due to a mere custom) when this annuls the Torah Mitzvah of Onah. Machazik Berachah (4) defended the Isur. With difficulty, Chachamim permitted Leil Tevilah! In any case, one should ensure that he is Tahor during the day - "Ki Kadosh ha'Yom lA'doneinu." Me'il Tzedakah (43) says that no one can annul Onah mid'Oraisa. If she pardons it, he may rely on this. Even though perhaps she pardoned due to shame (and really she is pained - Beis Shmuel and Chelkas Mechokek EH 76:7), here it is a Mitzvah (to be Tahor), so she willingly pardons. Also, awe of the day is also on her. I say that a woman marries with intent to pardon any custom of Prishus (separation for the sake of Kedushah) of a Mitzvah. Chachamim forbade relations in famine years (Ta'anis 11a), even though the verse brought is only an Asmachta (it is not truly mid'Oraisa). Likewise, they forbade relations during Aveilus.
Mishnah Berurah (26): If one cannot immerse due to the cold, he should at least pour on his body nine Kabim. He should not immerse before an hour before midday. Some say that it is proper not to have relations on either night unless it is Leil Tevilah. However, if one filled his stomach, or he had thoughts of a woman, it is better to have relations than to sin (have an emission). He immerses again in the morning.
Kaf ha'Chayim (82): The custom is to immerse even if he is not Tamei due to Keri, for Taharah of the body leads to Kedushah of the Nefesh. One must immerse before every festival, and all the more so for Rosh Hashanah, in order to stand in front of Hash-m in Taharah and Kedushah.
Kaf ha'Chayim (84): The custom is that also women, even virgins, immerse. They should comb their hair to remove Chatzitzos.
Kaf ha'Chayim (87): If it is Leil Tevilah, he has relations in fear, with excessive Kedushah. He should not be more lightheaded than necessary.
Kaf ha'Chayim (89): A Rav ruled that if one will not be able to immerse in the morning, he should not fulfill Onah of Leil Tevilah. This is wrong,
Shulchan Aruch (606:4): One may immerse (on Erev Yom Kipur) whenever he wants, just it must be before night. He does not bless on the Tevilah.
Beis Yosef (DH v'Nahagu): The Rosh brings from Rav Amram Gaon to immerse in the seventh hour.
Gra (10): The Shulchan Aruch rules like unlike Rav Amram Gaon, for the Tevilah is primarily for Yom Kipur (therefore, it is permitted until night - Damesek Eliezer).
Taz (4): It is good to immerse before Minchah, for then he confesses.
Kaf ha'Chayim (52): The primary time is after midday. One who wants to immerse earlier may immerse an hour before.
Rema: One needs to immerse only once, without Viduy, due to Keri.
Gra (15): It is due to Keri, but not due to R. Yitzchak, for it is impossible (to become Tahor) nowadays. See Bechoros 27a.
Damesek Eliezer: We learn from there that since we cannot become Tahor from Tum'as Mes, one need not immerse at all.
Mishnah Berurah (21): Even one who holds that it is due to Keri obligates one who immersed Erev Rosh Hashanah and did not see Keri since then.
Rema: Pouring nine Kabim of water over himself also helps.
Beis Yosef (DH Kasav): Tashbatz (Katan 122) would pour nine Kabim (the volume of 216 eggs) on himself on Erev Rosh Hashanah, Erev Yom Kipur and when he was a Ba'al Bris (Mohel, Sandek or father of the baby), since it is only for Taharah. It is not obligatory.
Magen Avraham (9): Mahariyo permits relying on nine Kabim if it is painful to immerse. One may immerse in 40 Sa'im of Mayim She'uvim (water that was in a Kli) in the ground, but not in a Kli.
Rema (ibid.): If one became an Avel between Rosh Hashanah and Yom Kipur, he may bathe and immerse on Erev Yom Kipur, for Yom Kipur annuls the laws of Shiv'ah (the first seven days of mourning). Even though the custom is not to bathe for 30 days, Tevilah of a Mitzvah is permitted.
Beis Yosef (DH Kasav Od): Tashbatz permits an Avel to bathe on Erev Yom Kipur only if it is at least the third day from burial. I do not understand how a custom to bathe on Erev Yom Kipur permits an Isur of Shivah.
Gra (19): Even when bathing is forbidden letter of the law, this is only for pleasure. Bathing for a Mitzvah is permitted.
Bach (DH ha'Beis): We permit (bathing) on every Erev Yom Tov! Perhaps the Rema holds that on other Yamim Tovim, we permit only close to dark. On Erev Yom Kipur, one cannot be so exacting (lest he transgress bathing on Yom Kipur), so one may bathe before Minchah.
Magen Avraham (10): The Rema answered this! Letter of the law one may bathe on any Erev Yom Tov, but the custom is to forbid the entire 30 days. On Erev Yom Kipur, we are not stringent. I say that even the Bach permits on Erev Yom Kipur only an hour or two before dark. One should conduct like this, for in any case some say to immerse after the meal before the fast.