AN ONEN IS EXEMPT FROM MITZVOS
(Beraisa): If one's Mes is in front of him, he does not eat in the same house. If he cannot, he makes a partition between him and the Mes. If he cannot, he faces away from the Mes and eats. He does not bless before or after eating; people do not bless for him (to exempt him from ha'Motzi), he is not included in a Zimun (of people saying Birkas ha'Mazon together);
He is exempt from Kri'as Shema, Tefilah, Tefilin and all Mitzvos.
Berachos 17b - Question: The Mishnah (17b) exempts one whose Mes is in front of him from Shma... The Beraisa exempts even one who eats in another house, i.e. even though his Mes is not in front of him!
Answer #1 (Rav Papa): The Beraisa exempts him when he faces away (but is in the same house, but not when he is in another house).
Answer #2 (Rav Ashi): Since he is obligated to bury the Mes, it is as if it is in front of him (wherever he is);
It says "Va'Yakam Avraham me'Al Penei Meso" and "V'Ekberah Mesi mi'Lfanai" -- as long as it is upon him to bury the Mes, it is as if the Mes is in front of him.
The Rif (Berachos 10b) brings our Gemara. He brings only Rav Ashi's answer.
R. Yonah (DH Mi) and Rosh (Moed Katan 3:54 and Berachos 3:1): Some, e.g. Rashi, say that an Onen is exempt because he is occupied with a Mitzvah, i.e. his Mes. If he wants to be stringent and bless or fulfill Mitzvos he may, just like a Chasan. The Gemara forbids even four Amos away (from the Mes). This connotes that he may not bless. Some say that the Isur to bless is only when he needs to do something for the Mes, but after doing what is needed, or if someone else is doing its needs, he may bless. The Yerushalmi says that he may not be stringent upon himself, due to the honor of the Mes.
Rosh (ibid.): The Yerushalmi forbids him to answer Amen, even though this does not Mevatel him from caring for the Mes. Also, it says that others read Shma and he sits silent. This implies that he is not caring for it at the time.
R. Yonah (DH Patur): The correct text says 'he is exempt from Kri'as Shma, Tefilah, and Tefilin'. It does not say 'all Mitzvos'. Some infer that he is obligated in other Mitzvos. He is exempt only from these three, which require great Kavanah. Tana'im (Sukah 26a) argue about whether or not a Chasan is exempt from Mitzvos. We rule like the opinion that he is obligated, and the same applies to an Avel.
Rejection (R. Yonah): Rashi explained that the Tana who obligates a Chasan holds that engaging in a Mitzvah does not exempt from other Mitzvos. The Halachah does not follow him. Rather, an Avel is exempt from all Mitzvos. The Tana taught three severe Mitzvos that contain Kabalas Ol Malchus Shamayim. All the more so he is exempt from other Mitzvos! The Yerushalmi explicitly exempts an Onen from Lulav and Shofar.
Rambam (Hilchos Evel 4:6): If one's Mes is in front of him, he does not bless before or after eating; people do not bless for him. He is not included in a Zimun. He is exempt from Kri'as Shma, Tefilah, Tefilin and all Mitzvos.
Mishneh l'Melech: The Manhir (73) says that all Mitzvos of the Seder apply to an Onen on Pesach. An Onen is exempt from Mitzvos only during the day, but not at night.
Rambam (Hilchos Kri'as Shma 4:3): If one's Mes is in front of him, he is exempt from Shma because his mind is not free to say Shma.
Kesef Mishneh: The Rambam teaches that he is exempt even if he need not do anything for the Mes.
Rosh (3:2): Once, the Ri was an Onen and ate without Havdalah. His Talmidim wanted to say Havdalah for him, but he said that the Yerushalmi forbids him to answer. After the burial the next day he ate without Havdalah. He explained that since he was exempt at the time of Chiyuv, also now he is exempt. R. Meir of Nurenberg says that he should make Havdalah after the burial. This is like one who was engaged with a Mes at the time to pray. If he finishes before the time for prayer ends, he prays. Here, the entire week is the time for Havdalah. Some say that he can be Yotzei by hearing others while he is an Onen. This is unreasonable, for he was exempt at the time.
Rosh (3:3): A case occurred in which a governor seized a Yisrael. The Yisrael died, and the governor did not release the body for burial. The Ri ruled that there is no Aninus. This is not 'one whose Mes is in front of him', since he cannot bury it. However, the relatives do not despair of burial, so Aveilus does not take effect. When Beitar was destroyed, the kingdom decreed that they will not be buried, so there was real despair. Here, they hope to Hash-m that the governor will consent to allow burial. However, they are not Onenim, for they cannot engage in burial. One opinion forbids an Onen to have relations on Shabbos, but this is only because he can make some preparations, e.g. to be Machshich Al ha'Techum. Here, this is like a Mes buried with intent to move it to another grave later. The Yerushalmi says that Aveilus begins from the second burial, but presumably Aninus ends after the first burial (since the Mes will not be moved for a long time). Likewise, if one is in prison Aninus does not apply to him. He is like one who gave the Mes over to others who will bury it. When R. Tam heard that his sister died in another city he had meat and wine, because her husband was obligated to bury her. This would apply even if she was in the same city. This is difficult. The Gemara implies that Aninus applies whenever Aveilus applies. According to R. Tam, it applies only to children of the Mes, but not to his father or brother!
Note: The Rosh does not explain why the father or brother of the Mes are exempt. Ma'adanei Yom Tov (40) says that he means 'it applies only to relatives like children, who inherit the Mes.' Alternatively, the text should say 'it does not apply to her children, father or brother' (if she was married).
Beis Yosef (OC 71 DH veha'Rashba): If a married woman died, the Rashba explicitly exempts her brother from Aninus even if he is in the same city.
Shulchan Aruch (YD 341:1): Even if an Onen is in another city, he does not recline, eat meat or drink wine.
Shach (5): It seems that this is even if there are Avelim in the city of the Mes who can care for it. This is like the Rosh. The Bach rules like R. Tam, who says that in such a case Aninus does not apply to relatives in other cities.
Shulchan Aruch (ibid.): He does not bless before or after eating; people do not bless for him. He is not included in a Zimun. If others bless he does not answer Amen. He is exempt from all Mitzvos of the Torah, even if he need not engage in needs of the Mes, e.g. if others are attending to them. Some say that even if he wants to be stringent to bless and answer Amen, he may not.
Beis Yosef (DH v'Chosav Od and OC 71 DH u'Mah she'Chosav v'Afilu): Some say that the Yerushalmi did not resolve whether or not an Onen may be stringent if others attend to the Mes. Some rely on this to pray in the Beis ha'Keneses in such a case. We need not protest against them, for this is a Safek mid'Rabanan, and Rashi and the Rambam permit to be stringent.
Rebuttal (Taz OC 71:3): We are stringent about a Safek mid'Rabanan only when there is no alternative! Why should one transgress honor of the deceased? Inaction is better.
Shulchan Aruch (OC 71:1): If someone lost a relative for whom there is Aveilus, even if burial is not incumbent on him, he is exempt from Kri'as Shma and Tefilah. He may not be stringent. If someone else will engage in burial for him and the Onen wants to be stringent, we do not protest.
Beis Yosef (DH veha'Rashba): The Tur learns Kri'as Shma from the law of meat and wine. The Rosh and Rambam exempt from Kri'as Shma even if he is not in the same city as the Mes; we follow them.
Taz (2): If others engage in the burial, all agree that one who lost his father should go to the Beis ha'Keneses to say Kaddish. This honors his father!
Magen Avraham (1): He should recite Shma and pray once they start to put dirt on the Mes.
Question (Levush): If a married woman died, the brother should not read Shma. Why is this different than an Avel who has someone else engage in burial for him?
Answer (Magen Avraham 2): If the Onen instructs someone else to bury, it is as if the Onen buries. Perhaps also regarding a brother we do not protest if he wants to be stringent!
Mishnah Berurah (3): If he said Shma before burial he was not Yotzei. He must repeat it after burial.
Mishnah Berurah (4): Once the Onenim give the Mes over to the Chevra Kedisha (who bury all Mesim in the city), they are immediately obligated in all the Mitzvos. If there is no Chevra Kedisha, even if someone else will bury the Mes, the Onen is exempt until burial.
Kaf ha'Chayim (3): If Reuven does not know that his relative died, and others will bury him, we should not inform him until after he prays, in order that he will pray. If he will bury him, we inform him immediately.
Kaf ha'Chayim (8): In a place where they do not allow burial within three days, the Onen is obligated in all Mitzvos, especially if others engage in needs of burial.
Kaf ha'Chayim (9): If a Safek Nefel died the parents are obligated in all Mitzvos, because there is no Mitzvah to bury it.
Kaf ha'Chayim (10): If he eats bread he must wash before and Mayim Acharonim, even though he does not bless. He also washes in the morning for Ru'ach Ra'ah.