Maybe this is a mindset we'll get over. The degree to which many of us evaluate ourselves based on our own usefulness seems like it's a bit too much but it's a normal human desire to be useful.
I certainly believe we should work towards a post-scarcity world where no one depends on my coding skills any more than they do my rock climbing skills, but it would be a psychological adjustment if every way I can be useful were now just a fun hobby.
I keep hearing from people that trying to give up on getting and starting to give instead, makes them receive more.
But yes, the shorter(?)-term "all physical and intellectual work can be achieved by AI/machines" leaves us with caring for each other, and that's the most fulfilling task.
I can only speak for myself, but in a world of universal basic income, I'm perfectly happy to pluck the strings of my guitar, play my piano, go for runs with my dog, play tennis etc. I don't believe there is any greater purpose to existence then what you can create for yourself.
Since my contentment comes from performing the actions themselves, whether or not a artificial intelligence can perform them better than me is simply a meaningless question.
Also I like to differ between performing and creating. For instance playing the piano might still be worthwhile but creating new music will lose its allure as AI will do it for you, faster and better. Saying that it's the same thing as there has always been someone who is better at creating than you, is a flawed argument. With AI there will be an infinite amount of creators that are better than you. Also AI isn't just competition, it's also your ally but the kind who'll say "step aside and I'll fix this for you."
Mountain climbing is superfluous by this logic- why would you bother climbing a mountain when you could just take a helicopter to the top? Or even more accessible: why would hike to a lookout when there's a road to take you to the same spot?
There is still joy and value in doing things the hard way, even if an easier way exists.