When you go to see a Pixar film you know you’re going to see something clever, funny and inventive. What you don’t expect, however, is to see a remarkably intelligent treatment of one of the most complicated and confusing philosophical issues of them all: the self.

I’ve written a PhD thesis on this and later a book, and whenever I talk about it, I go on about how the most credible and widely accepted theory (among philosophers, at least) is counter-intuitive and hard to grasp. Then some cartoon comes along which makes the key points intelligible to children. Inside Out has turned my world upside down.

The film takes us inside the mind of an 11-year-old girl, Riley, where five homunculi – Joy, Sadness, Anger, Fear and Disgust – are literally pushing all her buttons. Most critics have focused on how this neat device teaches difficult lessons in emotional maturity, most notably how you can’t be happy all the time and that sadness has its role to play too.

The film team review Inside Out Guardian

That’s true. But, albeit in schematic and simplified form, the film also reflects some of the most important truths about what it means to be an individual person.

The first of these is that there isn’t actually a single, unified you at all. Your brain is not a little world full of anthropomorphic creatures, of course. But it is made up of various different, often competing impulses. You are simply how it all comes together, the sum of your psychic parts.

This, however, is just the first crack at the myth of the enduring, unified self. What the film also shows is that each of these parts is impermanent. Riley’s personality is represented by a series of islands that reflect what matters most to her: friendship, honesty, family, goofiness and hockey. But as life becomes difficult, each of these in turns threatens to crumble. And that is how it is in the real world: as we grow and change and life takes it toll, some of the things that matter most to us will endure, others will fall away and new ones will come in their place.

In competition ... Sadness, Fear, Anger, Disgust and Joy. Photograph: Courtesy Ev/Rex Shutterstock

The third key element in understanding the self is that what keeps this all together is memory. At first, it seems like the film is going to over-simplify this, presenting memories as little movies, experiences that are captured, stored and played back. But as it progresses it gets more complicated. It becomes clear that not only do many memories simply get lost – even ones that were once most precious – others change their character as we do. For memories to do their work, they need to be nurtured and understood.

What it all adds up to is a picture of the self as something which coheres into a single narrative but which has nothing permanent and unchanging at its core. We are forever in flux, always in the process of growing out of what we once were into what we are to become next.

In flux ... Riley in Inside Out. Photograph: Pixar/Rex Shutterstock

I think the reason this can be conveyed in a children’s film is that, in many ways kids are more receptive to this message than adults. Children change so rapidly that they might be able to understand the idea of impermanence more readily than adults, whose self-conception has often ossified. Kids have no problem imagining that they might grow up to be quite different, while adults assume they are stuck being the person they have turned out to be.

The best children’s films often serve a dual purpose. They help kids to grow up but they also remind adults of what they have lost by doing so. Inside Out succeeds brilliantly on both counts.