Current debates over the automation of human jobs by AI tend to focus on how fast it will proceed: some jobs will be safe for the next decade, some for the next half-century, some for the foreseeable future. In this essay I want to take a different approach, by asking which (if any) jobs will continue to be done by humans even after the development of arbitrarily advanced technology.
[Here I've omitted a long section on why AI is capable of becoming arbitrarily competent; it was relevant to the original competition into which this essay was entered, but it's nothing new to anyone on this site. See my linked blog for the full post and references].
The fact that AI will eventually utterly outclass humans in performance on any given information-processing task does not mean that humans will necessarily be shut out from those industries: by Ricardian comparative advantage, it could still be profitable to employ humans even when they have no absolute advantage over AI.  However, since copying software is trivially easy, and the price of hardware continues to plummet, such roles will be very limited, especially if there is any sector of the economy in which humans have a comparative advantage over AI.
I claim that there is such a sector, consisting of what I shall call 'social jobs’. I define these as jobs where most or all of the value produced comes not from their outputs, but from the fact that they are being performed by other humans. The principle is most clearly illustrated by personal relationships: we want friends and partners who not only say and do the right things, but also really feel love and respect for us. In the economic sphere, there are particularly important social components of jobs in sales, management and leadership, and entertainment. To understand them, it's instructive to consider jobs whose value is almost entirely tied to the fact that humans are involved. Take chess, for instance. If we view the value of professional chess players as due to their production of high-quality games, then the advent of superhuman chess engines has rendered them entirely redundant. Yet professional chess not only still exists, but also features ever-growing prize pools.  So we are better to model chess players as entertainers, whose humanity is central to the existence of their jobs.
There are plenty more examples to consider. Fans of sports matches or rock concerts could often see and hear the performances better if they watched a broadcast from home; however, as with most entertainment, it's the atmosphere and sense of connection with the people around them that they value more. A robot could say and do all the same things as a lobbyist or politician, but still wouldn't thereby build the personal relationships that are crucial for both jobs. An AI counselor might be much more knowledgeable about psychology than a human one, and yet be much less able to convince the patient that someone actually cares about them. In all these cases, the outputs produced by an AI may be very similar to or better than a human's, but we would assign the latter much more value, because we care that there is a person on the other end of each interaction. In fact, humans will be able to do such jobs much better by incorporating analysis from AIs into their judgements - but human participation will still be essential.
Growth in these roles, and the social economy overall, will be driven by massive increases in overall wealth. Piketty estimated that world GDP increased by a factor of 140 between 1700 and 2012.  Historically, such gains have led to significantly increased spending on entertainment, and the rapid expansion of intrinsically social sectors like fashion and tourism.  Such spending is the most likely to support irreplaceable human jobs in the long term, for the reasons I outlined above - and there are good reasons to think that the current "Fourth Industrial Revolution" will be of even greater scale than its predecessors, allowing these social industries to grow rapidly. 
It may seem that, even so, there will simply not be enough social jobs for everyone. However, it’s unlikely that the current dichotomy between employment and unemployment will last indefinitely: technology is very good at introducing flexibility to previously rigid systems. Amazon's Mechanical Turk, for instance, is a marketplace where people can be paid for doing various tasks whenever they want, without any commitment or fixed hours. Driving for Uber or Lyft is the same. There are also now many games where you can trade virtual goods gained during gameplay for real money. These particular opportunities will eventually be automated away, but there will be plenty of replacements - and if global wealth increases to the extent suggested above, then such part-time jobs will be sufficient to maintain a reasonable quality of life.
In fact, we are already seeing surges in flexible social jobs, driven by the ease of connecting with people online. "Social media influencers" such as Instagram stars can earn millions; so can motivational speakers and life coaches with popular Youtube videos.  The massive earning power of media figures and celebrities is not a new phenomenon, but it's important to note the decreasing barriers to entry. Anyone can set up an Instagram account and start amassing followers (even if right now only a few can monetise effectively). Meanwhile, websites like Patreon, Kickstarter and meetup.com allow grassroots entrepreneurs and content creators to reach larger audiences (and profits) while remaining responsive to their supporters.
The ability of technology to facilitate peer-to-peer interactions suggests the potential for social jobs to become far more bottom-up (as opposed to the top-down model epitomised by TV culture). For example, during the last century an incredibly broad array of subcultures - from board game enthusiasts to queer communities to the worldwide competitive debating circuit - have largely been run by unpaid volunteers. However, if more wealth will indeed be funnelled into entertainment and leisure as the AI revolution progresses, and tools for distributing this money continue to be developed, then the economies of these communities will become more complex, with more opportunities to translate passion for a subculture into a decent wage. This is exactly what happened in many sports over the last century as participation and viewership boomed. Now millions of people are employed in sports-related jobs - and many such roles will never be automated away while the sport lasts, because their social aspects are pivotal in tying their respective communities together, and because they confer prestige within each community.
The exact activities and achievements considered prestigious will, of course, be mediated by cultural factors. For example, domestic workers make up less than 1% of the workforce in developed countries but up to a dozen times that in other parts of the world.  A significant portion of this disparity can be attributed to cultural reticence towards hiring "servants" in the West. However, in general, consuming goods or services is more prestigious the more scarce or expensive they are. For example, in very poor countries possession of factory-made "Western" products can be a proud distinction. Yet in countries where automated production of goods is commonplace, it is the opposite: markets such as Etsy are able to charge a premium for handmade goods. In a future where goods and services can be produced incredibly cheaply by automation, the ability to hire other people to work for you will remain a scarce resource, and therefore will in general become more of a signal of social status. Fast food outlets, which compete mostly on price, lead the restaurant industry in automation; whereas the fanciest restaurants and hotels, which compete mostly on reputation, will likely always keep their human waiters, chefs, valets, receptionists and concierges.
The predictions I have outlined above depend on people still caring about the distinction between humans and AI. I think this is likely. Friendships and relationships are fundamentally based on a mutual emotional bonds and shared concsious experiences between equals. Of course, consciousness is mysterious, and perhaps we will create AIs who (we are convinced) consciously feel emotions in the same way as humans. However, unless those AIs are specifically engineered to be very similar to humans, there will be certain facets of human relationships that they can't replicate. Could you feel like an equal in a friendship with a being who thinks ten thousand times faster than you, living a lifetime during each of your days? Or wholly trust a partner intelligent enough to manipulate you in any way they desired? I don't want to say that such shifts will never occur, but my best guess is that even in the very long term, most people will want their personal relationships to continue involving other humans. And as long as these non-transactional experiences are highly prized, then it will be economically valuable for human workers to evoke emotions that AIs do not. Even if distinguishing AIs from humans becomes difficult in some cases (e.g. via convincing facial and vocal simulations), it also seems likely that legal measures will be taken to prevent AIs from masquerading as human.
Finally, note that arguments above should not be taken to apply specifically to the coming few decades. Economically speaking, it is much more difficult to model transitions between equilibria than those equilibria themselves. While it seems very likely that most current jobs will eventually be replaced by the sorts of social jobs I described above, the exact path taken will depend on how fast technology advances, and how governments respond; the last few years have demonstrated that both of these factors are very tricky to predict. However, even when the most complex technical skills have become redundant, as long as the fundamentals impulses of human nature remain, there will still be an economy driven by humans and our social interactions.