This is one of the original SF 'What If?' ideas, a device a bit like a pair of old fashioned weighing scales, or symbolically as held by blind Justice, appears miraculously, with a spare. It was first printed in 1959 as 'The People Maker' but in the 1961 Four Square Books editions (HB and PB) expanded into 'A for Anything'.
What is the first thing to do? Make duplicates of the device and give them to your friends.
Of course this is the end of manufacturing and retail, and so the end of society as we know it. But not quite, since the original devices were small and fit in a suitcase, and someone must have made it, and eventually really big devices appear, big enough to duplicate almost anything, and if they are split in two, then able to copy at a distance.
The premise is impossible since it requires almost infinite energy, and the book is quite short and simple. But Damon Knight is a master of spinning a convincing tale and draws one in, and one feels for the characters and the plight they fall into, and how they cope or fail, and suddenly it's the end of the book. What happened next? I would have liked it to have been twice as long!
The ideas have been used many times over since, and many TV serials and feature films have hijacked the principle in one way or another. But it was done properly here, first, in one of Knight's early works.
Damon Knight was highly respected, one of the founders of the SFWA, and a prolific author and critic, and he died in 2002 aged 79.