ROME — Giuseppe Conte, finding himself in a traditionally precarious job, sought to avoid putting all his eggs in one professional basket by pursuing a fallback position as a teacher in a Rome university.

The twist: The basket in question is the Italian government. And Mr. Conte is its prime minister.

The news this past week that Mr. Conte was continuing to pursue a contingency gig — despite having become prime minister of Europe’s fourth largest economy — did not exactly inspire confidence in a populist and anti-establishment government that many here see as a grave threat to European Union. And Mr. Conte’s back-to-school backup plan was only the latest episode in a bumpy few weeks for the governing coalition.

A fatal bridge collapse in Genoa last month has exposed an ideological rift in the coalition between the business-friendly League party, which favors privatization, and the Five Star Movement, which has called for the state to take possession of major infrastructure projects.

On Thursday, Luigi Di Maio, the Five Star leader and the minister of labor and economic development, agreed to a deal to keep open what critics call an environmentally toxic steel plant — after spending years campaigning to close it.