President Barack Obama said he believes President-elect Donald Trump will be driven by pragmatism, not ideology, as he governs, but he warned the Republican businessman’s temperament could be an issue unless he shifts course once in office.

Mr. Obama, speaking at his first news conference since Election Day, said he has “concerns” about a Trump presidency, while expressing some hope that his successor may not unravel his legacy on health care, climate change and the agreement to restrain Iran’s nuclear program.

“He...