There will still be a functioning economy - serving the elite class. There will be a million people total who control all the resources. These people will form a new society, will have their own government, their own laws, their own values, products, services, etc. Everybody else will be out of luck: at first they will be given "UBI", then they will be cordoned into special zones, basically concentration camps, and eventually exterminated, because the elite has no need for them. Why waste resources on billions of useless humans, widely seen by elites as inferior species? They will probably make a virus to wipe us out and see that as a reboot of human race.
Or the technological singularity happens before that, and either AI will kill us all, or humans will merge with AI.