“Can I just say? I’m old,” Mr. Obama said. “That’s — but please, continue. Eighth grade!”

As the event unfolded, the participants were free to ask whatever they wanted, and Mr. Obama invited a couple of questions toward the end of the event. But they steered clear of asking any pointed questions about the current political situation in Washington and anything that might have been interpreted as a critique of Mr. Trump.

Ramuel Figueroa, an undergraduate at Roosevelt University in Chicago, did ask the former president about the challenges of getting day laborers to answer questions for a research project because of their increasing fears of being deported by the current administration.

Mr. Obama hinted at Mr. Trump’s aggressive crackdown on undocumented immigrants by saying that Mr. Figueroa needed to find someone the laborers would trust enough to talk to.

“That’s hard to do in this current environment, but it’s not impossible,” Mr. Obama said.

Mr. Obama’s choice of Chicago for his return to public life took him back to the place where he began as a community organizer decades ago.

In his opening remarks, Mr. Obama spoke fondly of starting his political career on the city’s South Side, where his presidential library will eventually be built.

“This community taught me that ordinary people, when working together, can do extraordinary things,” Mr. Obama said. “This community taught me that everybody has a story to tell that is important.”

In his final speech as president in January, Mr. Obama also traveled to Chicago and talked about the effect the city had on him as a young man. “It was on these streets where I witnessed the power of faith, and the quiet dignity of working people in the face of struggle and loss,” Mr. Obama said on Jan. 10. “This is where I learned that change only happens when ordinary people get involved, and they get engaged, and they come together to demand it.”