“I do believe part of what’s driving our politics in a negative direction is the information overload that is coming in through social media,” he said. “We are collectively, all of us, going to have to find ways in which we improve the conversation on the internet and social media.”
He added that the challenge will only become more difficult with widespread use of artificial intelligence.
“If you think fake news is bad now, what you’re going to start seeing is the ability to duplicate people’s speech so distinguishing what’s true and what’s not is going to become even more difficult,” he said.
Although the former president did not mention his successor Donald Trump explicitly, the contrast between the two leaders was clear.
Mr Obama spoke out in favour of tackling inequality and the “existential challenge” presented by climate change.
He also warned “nationalism, particularly from the far right, has re-emerged”, adding that despite Europe’s social achievements and decades of peace, “we know that powerful forces are working to reverse many of these trends”.
The town hall meeting was organised by the Obama Foundation, which aims to inspire participation in politics.
Mr Obama called on young people to play an active role in politics and not allow older generations to decide the direction of their country.
“When we hear that young people aren’t voting or participating, we say to them, you would not let your grandfather or grandmother decide what clothes you wear or what music you listen to, so why would you let them decide the world you’re going to live in?” he said.
“If we can get young leaders like you to begin to work together… to work in concert and teach and learn from each other, then you will change the world.”
Ms Merkel’s relationship with the US has become tense under the Trump administration, with the current president repeatedly criticising Germany’s contribution to military spending.
However, despite a warm reception in Berlin, Mr Obama ruled out returning to frontline politics by joking that his wife Michelle would leave him if he ever ran for office again.
Join our new commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies