Scarcity is an essential assumption in economic thinking. The entire discipline is built around the assumption that human desires will always exceed the resources available.
Some people assume that future technology will eliminate scarcity, and talk about 'post-scarcity economics'. They are mistaken. It is true that a lot of things that are currently expensive will get arbitrarily cheap, but scarcity will never disappear entirely.
This is easy to realize if you compare our current prosperity to the life of people 1000 years ago. Hundreds of things that were very expensive to them, from specific items like wire to paper, to general categories like food and energy, are incredibly cheap. A minimum wage job, or even disability payments from Social Security, would allow you to live a life that is far better, in terms of material goods and comforts, than a medieval aristocrat. And yet most of us still manage to run out of money.
There are many predictions dating from earlier in this century that technological progress would result in a 21st century where people worked 10 hours a day or less, and/or where there was massive unemployment. And it is true that we would only have to work 10 hours a day if we all accepted the standard of living they had in the 50's. But we want more, so we keep working.
But let us assume that technology becomes arbitrarily advanced while following all known laws of physics. Imagine a world where computers can fabricate almost anything for free using dirt, rocks, and spare biomass, and that we all have robot servants to cater to our every whim. Imagine uploading your brain to a computer network and living in any world you desire. What could be scarce in such a world?
Several things, it turns out.
Energy may get very very cheap, but we will never have an infinite supply. There is a limit to the amount of energy that the sun puts out. New technologies have a habit of generating new energy needs. No matter how energy-efficient your technology is, doing anything useful will eventually generate waste heat, and recovering energy form that waste heat would violate the laws of thermodynamics. Even if we built a dyson sphere to capture the entire solar output, there would be a limit on the amount of energy available.
Rare elements will always be scarce. Nanotechnology cannot turn lead into gold. The only way to turn one element into another is to hit the nucleus with a stream of particles, and hope that the particles are absorbed or that they remove bits of the nucleus. This is a very messy and energy-intensive process.
Real estate in meatspace will always be scarce. People will want land for privacy, or simply to play with. Even if we used the mass of the outer planets to construct a ringworld, people would desire more space than is available. It may seem ridiculous that we could use up so much space, but it is easy to imagine that everyone would want a private forest, mountain, jungle, coral reef, etc. as a personal playground. The only way that real estate would not be scarce would be if we had the technology to instantly teleport to any place in the galaxy and create new planets at will.
We will always need a way to allocate the limited supply of energy, rare elements, and real estate. That means either a market or some kind of central planning. Either way, you will need some kind of price system or credit allocation mechanism, which means money.
But suppose we find new laws of physics, and surpass all of those hurdles. Suppose we could teleport at will to any place in the universe, instantly convert any kind of energy into any kind of mass, or even create new universes. Will it be enough? No. No matter what arbitrary level of technology we possess, there will always be one scarce resource: the attention of sentient beings.
If you want a human to do something for you, you will have to pay that person somehow, to compensate for the loss of his or her time. Even if people are immortal, there will be things they would rather do than serve you. And people will want services that only other humans can provide. In fact, the easier it is to fulfull our material desires, the more we will focus on social desires, like talking to popular people and getting into the good clubs and parties.
We will not be able to get everything from AI beings. Either they are inferior to people in some way, in which case people still have value, or they are indistinguishable from people, in which case they will also have desires and will want to be compensated for their time. It is not possible to serve all desires by making AI slaves, or AI entities that have no desires and only exist to serve. Modifying them enough to make them work for free will always be enough to make them sub-human in some way, and people will want to interact with real people.
So there would be an economy built around social desires and interaction. People will pay you to do things like teach them or entertain them, and you will use the money to purchase services from other people. Scarcity, and economics, will exist as long as anything resembling humans exists.