The rising price of gasoline, groceries and rent has pushed inflation to its highest level in more than four decades. Prices rose even more than expected in May.