Many people think that in the future, all jobs will be taken by machines and AI. Why then, would anyone bother doing anything at all, such as invent things, fight in combat, etc - in other words, how can I create a science fiction world where people actually do things?
Boredom, Fun, and Other Puny Human Emotions
What else are people going to do? Sure, a robot does all jobs better and maybe for free, but people have to do something with themselves. Something that makes them feel fulfilled or like they've done something good in the world... something like having a job!
Maybe someone has realized that adding robots to their job means they can add their productivity to the robot's productivity...
And maybe, just maybe, people want to have a purpose in their life, even if it is waking up to do a job.
The Human Touch
Unpredictability may also be an asset to whatever complicated task the human is doing. Okay, a robot can have their programming randomized to introduce unpredictability, but maybe people find that a human presence is desirable for a job. (Like... a therapist? A priest? An actor?)
Maybe some corporations boast "security via obscurity:" humans are not hackable (but can be manipulated), are immune to electronic viruses, and don't worry about those pesky laws of robotics. In a world where all wars are exclusively fought in cyber space, people showing up with analog weapons becomes very, very devastating. We may be leaky meat-bags, but we don't make the same kinds of mistakes nor have the same vulnerabilities as robots!
Perhaps having some aspect of humanity is important, which AI's can't reproduce- like having a gut culture, bone marrow, or a fundamental understanding of the desires humans experience. Would AI's have empathy? Would people accept sympathy from an AI?
People still knit despite machine knitting being far faster because they enjoy it. Like many kinds of art and hobbies, people will make things and do things because they want to. Science used to be done by rich lords who could afford to do nothing if they wanted to but were curious about how the world worked.
Humans will play while machines do all the hard or unpleasant work. Look at how those on holiday behave, or those rich enough to pay others to do menial work.
This will mean lots of people doing nothing, but quite a few doing art and some inventing things. (if the AI is really smarter than humans it will be better at inventing, but people will pursue science and invention for the fun of it anyway.) You wouldn't have anyone fighting in combat because doing so is unpleasant and dangerous. With this sort of tech you will easily be able to provide all humans with plenty and luxury. (this is why we are getting less violent, a starving man will risk death in war for a little food but a better of person will not and we are getting richer)
You will have plenty of people playing ultra realistic VR fighting games and real life, fake fight games like paintball or lasertag.
Many people think that in the future, all jobs will be taken by machines and AI
Anyone who believes that likely holds one of the jobs that will be taken over.
Really, I find that those who hold this opinion can be quickly divided into two camps. There are those who look at this outcome and hang their head in shame at the eventual obsolescence of humans. Then there's the transhumanists, who see this not as the end of H. sapiens, but the beginning of something more. If you're going to write a story about this scenario, you should start by deciding which of these opinions you want to focus on. They play out very differently.
In the obsolescence story, there's no good reasons for humans to do anything, but we keep doing it anyways. Typically this is because of bureaucracy. We pass laws to ensure humans still have jobs. Such stories typically revolve around humanity's unwillingness to die off. As such, the jobs are typically those which could be automated, but we have made a conscious decision not to automate them.
In the transhuman story, we instead see the rise of AIs not as replacements, but as children. The goal becomes to raise them as better people than we are, so that we leave the world as a better place that we found it. As such, the jobs are typically teaching positions and mentorship positions. Their job is to transfer the mantle of humanity onto these new forms.
The common beliefs between those two extremes is that humanity itself has some intrinsic value. There's some reason to keep humans around. One of the most important reasons which is often given is the value of our intuition and "human spirit." These are topics which are tremendously difficult to speak of scientifically, but we can see the side effects. One of those most impressive differences between AIs and humans is that humans are amazingly versatile. We can operate meaningfully in many different environments:
A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.
-Robert A. Heinlein
The two views differ on whether or not an AI can ever replace this. The obsolescence camp argues that AIs will never reach this point, and thus the loss of H. sapiens is the loss of this capability. The transhumanists argue that an AI can be taught to do these things. To them, the idea that an AI can learn these things is no more surprising than the idea that a 1 year old who poops their pants because they don't know any better can be president of the United States forty years later.
You might draw inspiration from some existing post-scarcity worlds. Most notably, Ian M. Banks' The Culture has AI so sophisticated and technology so all-encompassing that no one wants for anything.
The motivation seems an easier question to answer, though - experiences are still of value. There could even be (and has been, in works by people like John Varley) a marketplace for recorded unusual experiences: skydiving in a gas giant, running the rapids in a world comprised entirely of massive rivers, unusual sexual experiences, etc.
But even if recorded memories are available, you'll have people insisting that it's not like the real thing, and going out to do it themselves.
Addressing specifically "inventing things", it's likely that even with sophisticated AI, you'd have something similar to what the big mobile app houses have now: a person comes up with an idea for an app/device/whatever, explains it in detail to their home fabber AI, and it handles the actual implementation. Everyone becomes an inventor, and the most popular fabrication schemes gain reputation for their creator (since in a post-scarcity society, money wouldn't have any real meaning).
Two reasons: reputation and boredom.
People are (for the most part) deeply social animals. We spontaneously form groups and hierarchies, and we judge our status within groups by the results of our actions. Although such judgements can become trivialized, a proper use of media can inculcate common values and standards which are based on some sort of utility or achievement.
And as for boredom, consider T.S. Eliot's The Rock:
The fate of man is ceaseless labor, or ceaseless idleness, which is yet harder.
Artisanal, handmade, homemade, hand crafted, custom built these are the words of your future. There are millions of products today that could made cheaper and easier by machines but we pay more to have that handcrafted touch. As an example more listed blacksmith as their profession today than at any point in our counties history. mechanization will only expand creativity, we see that today, look at the rise of indie gaming, now that a game is nothing more than easily transferable code anyone can create a game.. Book publishing is easier than ever and thus the number of authors has skyrocketed. What will the world be like when we hand crafted custom designed cars that cost the same as a factory car thanks to automation, when making a movies is as easy as writing a song today thanks to better computers. Imagine when every home is custom designed because construction is done by automaton or clothing design is as easy as making a sketch. In enough time the only limit on your creativity will be your imagination and inspiration.
It provides a social life, and people enjoy doing things and doing them together. The product is not the point, producing it is the point. Sure, my wife could get a robot to tend her garden perfectly; but then she probably just wouldn't have a garden: She wants to the work, pick out the plants, position them, dig in the dirt and nurture them and check on them, trim them and care for them. Only then can she take pride in the flowers she has grown and the living artwork she has created.
It is the difference between buying a piece of art, and making a piece of art yourself. Between buying a good meal, and making one yourself. Between reading a book and writing one. A person that takes just as much pride in a purchased piece of art as one they made themselves has a deeply disturbed psychology; I'd consider that condition non-human.
Doing something gives people a purpose in life, even if the purpose is short-lived. My retired neighbor (she is a retired CS professor) loves dogs and volunteers at the dog shelter. She washes dogs for about three hours a day, inspecting them for pests or injuries. She does not want robots doing this job, she feels connected to the dogs she is helping and to the like-minded volunteers at the dog shelter, and after retirement this has become a significant part of her social life.
As for the dog shelter: Robots cost money, and it is hard to beat free labor.
As a final example, let me point to the ultra-rich in the world. They already have "robots": They can hire humans (and humans much smarter than themselves) to do literally everything in their lives. Yet many of them still take on various kinds of jobs and charities, even full time. Why is Bill Gates directing a charity? It isn't for the money, or to make sure his money is well spent. He could hire trusted subordinates (robots) to do that; just like he hired people to run Microsoft. It is because it puts meaning in his life.
Why is Warren Buffett still running an investment firm at the age of 80 plus? It isn't for the money, he gave away $30 billion dollars (to the Bill and Melinda Gate's charity), the bulk of his fortune. He is still a multi-billionaire that lives in a modest house, plays bridge and still eats fast food burgers. He doesn't exactly give a crap about earning more money: He just enjoys the puzzle of finding massive investments and being proven right, and the money rolls in as a side-effect. Like my wife's garden, he can't get those feelings if somebody else does the work.
The answer to the question is, people will bother to do things for themselves, even if those things appear to be work, because doing those things feels good and are emotionally satisfying; and would not be if robots did the work for them.
Actually robots will never replace humans in a lot of jobs: nurses, teachers, and other social based jobs will always require human contact or that 'touch'.
maybe a mix of terminator-paranoia and humans being social animals so they can't just stay in their houses doing nothing, they need to make social groups.