HA'TOV VEHA'METIV
Gemara
(Rav Masneh): On the day that they were able to bury those killed in Beitar, the Sanhedrin in Yavneh enacted the fourth blessing of Birkas ha'Mazon, 'ha'Tov veha'Metiv'.
'Ha'Tov' - Hash-m kept the bodies from decaying. 'Ha'Metiv' - He enabled that they will be buried.
Berachos 49a (Aba Yosi ben Dosta'i or Rabanan): One must mention Malchus (Hash-m's kingship) in ha'Tov veha'Metiv;
(The other of Aba Yosi ben Dosta'i and Rabanan): One need not mention Malchus in ha'Tov veha'Metiv.
The first opinion holds that ha'Tov veha'Metiv is mid'Rabanan (it is an independent Berachah by itself, therefore it needs Malchus). The latter opinion holds that it is mid'Oraisa (it follows the other Berachos of Birkas ha'Mazon. Malchus in the first Berachah suffices for all of the Berachos).
(R. Yochanan): One must mention (Hash-m's) Malchus in ha'Tov veha'Metiv.
Question: Is the Chidush that every Berachah needs Malchus? R. Yochanan already taught this!
Answer #1 (R. Zeira): He teaches that two Malchuyos are required. The second is to compensate for not mentioning Hash-m's Malchus in Boneh Yerushalayim.
Question: If so, a third Malchus should be required, to compensate for not mentioning Malchus in Birkas ha'Aretz!
You must say that we need not compensate for (omitting Malchus in) Birkas ha'Aretz, for it is adjacent to another Berachah (the Malchus of Birkas ha'Zan counts for it). Likewise, we need not compensate for Boneh Yerushalayim, for it is adjacent to another Berachah!
Answer: Indeed, compensation for Boneh Yerushalayim is not because it lacks the Malchus that every Berachah needs. It is not lacking, for it is adjacent to another Berachah. Rather, it is improper to mention Malchus Beis David without mentioning Malchus Hash-m. For this we compensate in ha'Tov veha'Metiv.
Answer #2 (Rav Papa): Two Malchuyos are required in ha'Tov veha'Metiv, in addition to the usual Malchus at the beginning.
Rishonim
Rif (Berachos 36a): Ha'Tov veha'Metiv was enacted in Yavneh when they were able to bury those killed in Beitar. Rav Papa taught that two Malchuyos are required in ha'Tov veha'Metiv, in addition to the usual Malchus.
Rambam (Hilchos Berachos 1:17): We answer Amen to Boneh Yerushalayim because it is the end of the primary Birkas ha'Mazon. Ha'Tov veha'Metiv was added by Chachmei ha'Mishnah.
Rosh (Berachos 7:22): Ha'Tov veha'Metiv was enacted in Yavneh when they were able to bury those killed in Beitar. It was enacted in Birkas ha'Mazon, which is all praise. The Yerushalmi says that when Beitar was destroyed, the horn of Yisrael was cut off, and it will not return until Mashi'ach. Therefore, it was put next to Boneh Yerushalayim. It was enacted to mention Malchus Beis David in Boneh Yerushalayim. We should mention also Malchus Hash-m in the Berachah, but Chachamim did not want to have Hash-m's Malchus next to human Malchus, so they enacted to mention Hash-m's Malchus in ha'Tov veha'Metiv. Once they enacted Malchus in ha'Tov veha'Metiv corresponding to Boneh Yerushalayim, they also enacted Malchus in ha'Tov veha'Metiv corresponding to Birkas ha'Aretz (which does not have Malchus, for it follows Birkas ha'Zan). The Medrash says that one must mention in ha'Tov veha'Metiv three Hatavos and three Gemulus (bestowings - Hu Gemalanu Hu Gomleinu Hu Yigmeleinu la'Ad). Even so, we do not close the Berachah with Baruch Atah Hash-m... for it is considered a short Berachah. It was initially enacted to say only ha'Tov veha'Metiv, and later these other matters were added.
R. Yonah (DH uv'Kan): Tosfos says that we do not close the Berachah because it is a short Berachah. It is all one matter. All the additions are descriptions of Hash-m, i.e. he is King, does good, bestows...
Beis Yosef (OC 189 DH u'Mah she'Chosav Rabeinu): The Rashba says that we do not close the Berachah because we do not want to make it better than the second and third Berachos, which are mid'Oraisa.
Poskim
Shulchan Aruch (OC 189:1): In the fourth Berachah, we mention kingship three times - Baruch Atah... Melech ha'Olam... ha'Kel Avinu Malkeinu... ha'Melech ha'Tov. It mentions three Hatavos - He did good to us, does good to us, and will do good to us.
Taz (1): Since ha'Tov veha'Metiv is only mid'Rabanan, it begins with Shem and Malchus.
Magen Avraham (1): Nowadays the custom is to say ('to us' only at the end,) 'He did good, does good, and will do good to us', for we already said 'ha'Tov veha'Metiv.'
Machatzis ha'Shekel (1 DH Hetiv): The Shulchan Aruch holds like the Rosh, that we must say three Tovos other than ha'Tov veha'Metiv, which refers to the events in Beitar (the bodies did not decay, and they were able to be buried). Our custom is to count them among the three, so we say 'He did good, does good, and will do good to us', and this counts like one.
Eshel Avraham (1): We say 'to us' only regarding the future, for this is a Tefilah. Clearly, He did and does good to everyone!
Birkei Yosef (2): Some say that one says first 'He does good to us' (present). Our custom is is like the Mechaber.
Hagahos Tur ha'Shalem (6): In old editions of the Tur and a Kesav Yad, the text puts 'He does good' (present) first, and similarly regarding 'Hu Gomleinu.' This is like "Hash-m Melech Hash-m Molach Hash-m Yimloch.'
Prishah (4 DH v'Ha): The Tur explained why we mention Malchus three times. He did not need to explain regarding Hatavah and bestowing, for there it is to mention past, present and future.
Mishnah Berurah (4): Since we mention kingship three times, we mention three Hatavos, for the Berachah was enacted due to Hatavah.
Darchei Moshe (1): The Mordechai (at the very end of Berachos) says that we close Birkas Ba'al ha'Bayis 'v'Imru Amen', not v'Nomar Amen.
Mishnah Berurah (5): We conclude Birkas Ba'al ha'Bayis (surely this is the correct text, like it says in Magen Avraham 1, which the Mishnah Berurah is citing verbatim - PF) v'Nomar Amen, for (it is a request that Hash-m bless the Ba'al ha'Bayis, and) he cannot demand that others answer. Oseh Shalom bi'Mromav is praise of Hash-m, and all Yisrael must answer Amen, therefore, we conclude v'Imru Amen.
Machatzis ha'Shekel (DH she'Hu): Even though Oseh Shalom concludes with a request (Hu Ya'aseh Shalom...), it is primarily praise of Hash-m. Also, one must answer Amen to the praise it contains.
Eshel Avraham (1): One who says Birkas ha'Mazon alone cannot say 'v'Imru Amen', nor v'Nomar Amen. He says just Amen.
Kaf ha'Chayim (10): The custom is that even an individual says v'Nomar Amen, just like an individual says 'v'Imru Amen' at the end of Birkas ha'Mazon (and at the end of Shemoneh Esre, even though no person hears him - PF).