The writer Zadie Smith laid into identity politics in a headline session at the 14th Hay Cartagena festival, insisting novelists had not only a right, but a duty to be free.

Asked how she felt about cultural appropriation, she told an audience of nearly 2,000 at the festival in Colombia on Friday: “If someone says to me: ‘A black girl would never say that,’ I’m saying: ‘How can you possibly know?’ The problem with that argument is it assumes the possibility of total knowledge of humans. The only thing that identifies people in their entirety is their name: I’m a Zadie.”

She conceded that the assertion of a collective identity was sometimes necessary “to demand rights”, but cited the dismay of her husband – the poet and novelist Nick Laird – at finding himself increasingly categorised. “He turned to me and said: ‘I used to be myself and I’m now white guy, white guy.’ I said: ‘Finally, you understand.’ But the lesson of that is that identity is a huge pain in the arse. The strange thing to me is the assumption [of white people] that their identity is the right to freedom.”

She went on to question the role of social media in policing personal development. “We are being asked to be consistent as humans over great swathes of time. People are searching through social media. But everyone is changing all the time.”

In an essay in her collection, Feel Free, she investigated one such change in herself, when she fell in love with the music of Joni Mitchell, a singer she had despised when she was a mixed-race teenager growing up on a London housing estate. “The reason for hating Joni Mitchell was that I didn’t listen to classical or ‘white’ music,” said Smith. “Then I had an epiphany, and suddenly realised that her voice was beautiful. It’s a responsibility to be as open as you possibly can to the world as an aesthetic object.”

Returning to the issue of political correctness, she reflected on her debut novel White Teeth, which had depicted characters from many backgrounds but, she said, had been given an easy ride by the white critics because “[its characters] were mostly brown. It had all sorts of mistakes I’m sure but if I didn’t take a chance I’d only ever be able to write novels about mixed-race girls growing up in Willesden.”

Speaking in the home city of Gabriel García Márquez, Smith admitted that she was not a great fan of magic realism, preferring to deal in more concrete realities.

She ended by citing Gustave Flaubert’s Madame Bovary as an example of the power of the reprobate imagination. “Women have felt very close to these fake, pretend women invented by men. It makes us feel uncomfortable in real life. This is not real life. It’s perverse, but it’s what’s possible in fiction. There’s no excuse for its irresponsibility, but fiction is fundamentally irresponsible.”