Replicators were derived from Transporter technology.
It's been stated/confirmed on-screen.
Also, one can indeed make a transporter using just a replicator... you'd need to replicate it in pieces which you'd assemble later on, but that's pretty much it.
In terms of which I'd rather pick...
Well, the replicator of course.
If it came with an appropriate power source, I'd use it to create food and most of the resources needed for self-maintenance so I don't have to be forced into what society does (to make you earn money in order to survive - a despicable aspect to say the least).
Next I'd probably construct a low-powered transporter, learn how to operate it, and use it once every 20 years (or so) to rejuvenate myself.
I'd also have to learn of a way to properly conceal both technologies in order to not risk the government from taking it (which would probably require of me to construct a self-contained 24th century environment/small facility the size of a shuttlecraft that would respond to my control only.
I'd probably also use the transporter in conjucture to bring fresh food and water in decent quantities to those who need it most (including proper material needs).
This would of course have to be done on a sparing basis though.
Furthermore, if technology such as the replicator or the transporter would be put into production or the market today, you can rest assured that you'd be prohibited from replicating certain matter such as money, and numerous other aspects.
Anything beyond food, water and clothing would likely be prohibited, and you'd have to pay extremely high prices to replicate something else, or they would simply limit you that you can replicate items for specific amount of money (I doubt they would release replicators for everyone to have one in each home).
Though furthermore, one can probably take into account the very real possibility that if such technology is seized by people in power, it would never see the light of day.
Or it would be exploited to boost those people's positions and simply develop better technologies using the replicator as a basis, and charge insane prices.
Society as such would indeed collapse if the replicator would be used to it's fullest potential as in the show (though to put something else to rest, humanity got rid of famine and poverty centuries before the replicator was invented... approximately within 50 years after FC - which is an era when they did NOT have replicators).