Inflation accelerated last month as consumer prices shot up at an annual rate of 12.7 percent, the government said yesterday in the last major economic report before the election.

Grocery store prices led the way, rising 1.9 percent, after going up 2.3 percent in August. The purchasing power of an average hour's work fell 0.7 percent, the Bureau of Labor Statistics reported.

In the Washington area, the bureau said in a separate report, consumer prices rose less than 1 percent in the last two months, the smallest such increase in more than a year. The bureau attributed this mainly to declining mortgage interest rates, which since have rebounded. [Details on Page C1.]

The worsening inflation is bound to be an issue in the closing days of the presidential campaign. It will help Republican candidate Ronald Reagan in his attempt to convince voters that President Carter has mismanaged the economy.

"It's one more sign of [Carter's] total incompetence," Reagan's press secretary said yesterday. And Reagan economic adviser Alan Greenspan suggested that the administration made the figures look better than they might have. The Department of Housing and Urban Development delayed raising the FHA/VA mortgage rate until after the September consumer price figures were compiled. Earlier action could have lifted the September inflation rate to 13.7 percent, Greenspan said.

Carter tried to turn the bad inflation news to his advantage by emphasizing inflation dangers in Reagan's tax-cut proposals. The September figure "confirms the wisdom of our policy" of holding down spending and resisting an early tax cut, the president said yesterday.

Sharply rising food prices were partly responsible for last month's inflation speedup. Mortgage interest rates were another factor. By falling in earlier months they had worked to hold down the inflation rate; in September they did not fall as much.

Grocery store prices went up by 1.9 percent in September, while prices as a whole rose by 1 percent. More food price increases lie ahead.

Tightening food supplies after the summer drought will push retail prices up steeply next year, Agriculture Department economist Terry Barr predicted yesterday. Pork prices in the first six months of next year will be 25 percent or more above this year's level, while beef prices will rise about 10 percent, he told reporters.

Carter's inflation adviser, Alfred Kahn, said earlier this week that food prices, which helped to moderate inflation earlier this year, would be working in the other direction from now on.

In the 12 months to September, consumer prices overall went up by 12.7 percent -- coincidentally the same figure as last month's annualized rate. Total food prices went up by 10 percent in the same period.

September's price rises wiped out the month's wage gains. Hourly wage rates, after adjusting for inflation, dropped by 0.7 percent. A rise in the number of hours worked meant that gross weekly earnings fell by only 0.3 percent.

When Social Security and federal income taxes are taken into account, the spendable income of a typical married man with three dependents dropped by 0.4 percent in September, seasonally adjusted. Over the year these earnings fell by 6.7 percent, after allowing for inflation.

Although low earnings may discourage voters from supporting the administration, in one sense they are good news for Carter. The underlying rate of inflation, and the prospects for the future rate, depend crucially on wage costs. Key administration economists believe that the underlying inflation rate is now about 8 1/2 to 9 percent, after very moderate wage increases in the summer months.

Sizable price rises occurred in many categories in September, with transportation costs up by 1.2 percent, clothing up by 1.3 percent and only medical care and housing costs rising by less than 1 percent.

The consumer price index has been very volatile this year, as inflation surged in the early months of 1980, slowed sharply and then picked up somewhat.

In the first three months of the year the CPI went up by 18.1 percent at a seasonally adjusted annual rate. This dropped to 11.6 percent in the second quarter, and to 7.0 percent in the three months to September.

However, the slowdown in the latest three months was accounted for by the housing component. This is calculated in a way which exaggerates and delays the effect of mortgage interest rate changes, so that the third-quarter improvement reflected an earlier drop in interest rates which has since been at least partially reversed.