Consumer prices were flat in June from the prior month and annual inflation remained well below the Federal Reserve’s 2% target, a potential yellow flag for the central bank as it considers interest-rate increases later in the year.

Inflation is turning into a conundrum for the Fed. Officials have been expecting a pickup as the economy improves, but it isn’t appearing.

The...