Right so there's three main points we get taught in High School in America about the subject.
Anyway, I guess to be more nuanced if I'm not too much already, is the Russian Federation a continuation of the Union? If not, who exactly decided to just make the nation a democracy with a capitalist system?
The first two items are something along the lines of "myths" about the dissolution of the USSR.
Regarding "socialism failed": the centralized command economy as run by the USSR was becoming increasingly complicated to run and having increasing difficulty closing the ever-present gap in GDP with major capitalist countries. However, there was nothing inevitable in this "stagnation" leading to the collapse of the entire system - it probably could have muddled through in some fashion. The direct catalyst for the collapse was Gorbachev's political and economic reforms further destabilizing the economy and society, and unleashing political forces that he was unable to control. I wrote a more in depth explanation of that here.
As for "the US outspent and bankrupted the USSR in the Cold War": this also is a myth with a kernel of truth. The Soviet economy pretty much from the mid 1930s onwards had a heavy focus on prioritizing military needs, to the point that, while the US spent more money in absolute terms, the Soviets spent a much larger percentage of their much smaller GDP on the military. Any shift to, say, a greater focus on consumer goods and services meant that some sort of shift in allocation of resources would he necessary, and this is what Gorbachev was hoping to accomplish through political reforms and new foreign policy that aimed to lessen Cold War tensions and Soviet military and foreign commitments. I wrote a longer answer - specifically on whether Reagan's Star Wars program bankrupted the USSR - here.
As for #3: there is some larger truth to this, in that, as mentioned above, the Gorbachev reforms unleashed secessionist tendencies and depending where one was in the USSR, this could be a popular movement or not. On one extreme you'd have, say, Lithuania, with a big popular national movement pushing for independence, holding democratic elections, and manning barricades to fight Soviet military forces, and on the other you'd have, say, Turkmenistan where all the same party and government officials remained in power and just changed the labels on their office doors. The big final push for dissolution of the Union (which was in any case already being renegotiated between Gorbachev and the republics) was the August 19, 1991 coup attempt against him, which I discuss a little here.
As for "is the Russian Federation a continuation of the Union"? Yes and no. Russia is the legal successor state to the USSR, which means it inherited the Soviet UN Security Council seat, and ultimately all of the Soviet nuclear arsenal, as well as Soviet treaty commitments and foreign debt. But technically the Russian Federation is one of the former Soviet Socialist Republics (the Russian Soviet Federative Socialist Republic or RSFSR) just like the other 14 former SSRs - one part of the former federation, albeit the biggest one by far. While the Russian Federation inherited or even intentionally took over a lot of union-level institutions, in theory the much much looser Commonwealth of Independent States replaced the Union. In any case, Yeltsin continued political and economic reform programs much further than Gorbachev, so the political and economic system is considerably different from the Soviet period.