In the end, it was a father speaking with pride about his daughters and why they give him hope for the future.

The final question put by a journalist to Barack Obama during his presidency merged the political with the personal. Indeed, the two have often been impossible to separate during his eight years in office.

So how, Obama was asked at his last press conference on Wednesday, did Malia, 18, and 15-year-old Sasha react to Trump’s victory in the presidential election? His answer revealed something about his own attitude and, perhaps, his parting advice to an uncertain nation and world.

“What we’ve also tried to teach them is resilience, and we’ve tried to teach them hope, and that the only thing that is the end of the world is the end of the world, and so you get knocked down, you brush yourself off and you get back to work,” he said. “And that tended to be their attitude.”

Neither intends to pursue a future in politics, he added. “But both of them have grown up in an environment where I think they could not help be but patriotic, to love this country deeply, to see that it’s flawed but see that they have responsibilities to fix it, and that they need to be active citizens and they have to be in a position to talk to their friends and their teachers and their future co-workers in ways that try to shed some light as opposed to generate a lot of sound and fury.

“I expect that’s what they’re going to do. They don’t mope, and what makes me proudest about them is they don’t get cynical. They don’t assume because their side didn’t win, or because the values they care about don’t seem as if they were vindicated, that automatically America has somehow rejected them or rejected their values.”

Against a backdrop of stars and stripes and presidential seal flags, Obama stood at the podium at the White House for the very last time. Over eight years, at this spot, he has addressed the nation through highs and lows, sometimes choking with emotion when responding to incidents of gun violence.

But in the press briefing room in the west wing on Wednesday, with all 49 seats full with reporters from all over the world and a chorus of cameras clicking, there was little room for sentiment.

Obama has been criticised by rights groups for using the 1917 Espionage Act to prosecute more leakers and whistleblowers than all previous administrations combined, as well as seizing the phone records of a news agency. But on Wednesday, he sought to position himself as a defender of the free press. “You’re not supposed to be sycophants,” he told them. “You’re supposed to be sceptics. You’re supposed to ask tough questions.”

Obama signalled that a threat to press freedom would be one of the “core values” that would move him to break with presidential tradition by speaking out from a retirement that he intends to spend writing, enjoying quiet (“not hear myself talk so darn much”) and spending time with Malia and Sasha; on Friday they travel to Palm Springs, California, for a holiday.

Nonetheless, he drew some lines in the sand that Trump’s past rhetoric has threatened to cross.

“There’s a difference between that normal functioning of politics and certain issues or certain moments where I think our core values may be at stake,” the president said. “I put in that category if I saw systematic discrimination being ratified in some fashion. I put in that category explicit or functional obstacles to people being able to vote, to exercise their franchise.

“I put in that category institutional efforts to silence dissent or the press. And for me at least I would put in that category efforts to round up kids who have grown up here and for all practical purposes are American kids and send them somewhere else, when they love this country.”

The question-and-answer session ranged from progress on LGBT rights to the early release of whistleblower Chelsea Manning to disappointment in Israeli-Palestinian relations and Russian aggression. Despite the bruises of his two terms, Obama insisted that his original optimistic vision remains intact. Although Democratic candidate Hillary Clinton fell short, he spoke of one day expecting to see a female president, a Latino president, a Jewish president, a Hindu president and many others. “We’ll have a whole bunch of mixed-up presidents at some point that nobody knows really knows what to call them.”

Obama gave dire warnings during the election campaign that democracy and tolerance were on the ballot and that all the progress of the past eight years would go down the drain if Trump prevailed. Yet since the outcome he has, to the frustration of some liberals, been restrained in his comments about a president-elect who appears to be his living repudiation and, critics say, represents a national and global emergency. Even Clinton once remarked that she was the only thing standing between America and an “apocalypse”.

Obama, however, rejected the view that he is expressing insufficient alarm at what will begin with Friday’s inauguration. “I’ve had some off-the-record conversations with some journalists where they’ve said, ‘OK, you seem like you’re OK but really, really, what are you thinking?’ And I’ve said, ‘No, what I’m saying really is what I think. I believe in this country.

“I believe in the American people. I believe that people are more good than bad. I believe that tragic things happen, I think there’s evil in the world, but I think that, at the end of the day, if we work hard, and if we’re true to those things in us that feel true and feel right, that the world gets a little better each time. That’s what this presidency’s tried to be about, and I see that in the young people I’ve worked with.”

He added: “At my core, I think we’re going to be OK. We just have to fight for it, we have to work for it and not take it for granted. And I know that you will help us do that. Thank you very much, press corps. Good luck!”

With that he waved his left hand, banged the lectern twice and walked away, followed by a hail of camera clicks and shouted questions that would never be answered.