Industrial production fell 0.1 percent in May, the second monthly decline in a row, leaving the output of the nation's factories, mines and utilities only 1.5 percent higher than it was a year earlier, the Federal Reserve reported yesterday.

Although the decline in May was very small, it underscored the uncertainties surrounding the future course of the economy. American goods-producing industries, competing against a surge of imports, are trimming production while other parts of the economy, including services and retail trade, continue to add employes.

Meanwhile, the Labor Department said that producer prices for finished goods rose 0.2 percent last month, largely because of further increases in the cost of energy. Finished goods prices in May were 1.1 percent higher than a year earlier, with the same competition from imports also forcing U.S. producers to hold down their prices.

Consumer foods prices fell another 1.1 percent, the fifth month in a row in which they either fell or were unchanged. Capital equipment prices were unchanged, the report said.

At the White House, spokesman Larry Speakes said the price report was "yet another indicator that inflation at the wholesale level remains extremely low."

As for the production numbers, Speakes declared, "It is true that the figures on industrial production are not as good as we would like them to be," but details from the auto and housing industries indicate "a resumption of the recovery."

The industrial production index had dropped 0.2 percent in April, a month in which output was falling in substantially more industries than it was rising, the Federal Reserve said. Many analysts had been expecting at best only a small rise in the production index for last month because the Labor Department's May figures for total hours worked, released last week, showed no change from April.

Manufacturing employment went down by 28,000 jobs in May and is down 163,000 since January, the Labor Department said in that report. In fact, unemployment is worse now in several industries -- including steel, textiles, oil and coal, chemicals and tobacco -- than at the bottom of the 1981-1982 recession, it added.

In May, only utility output rose strongly, up 0.8 percent for the month. Both defense and space equipment and construction supplies increased 0.3 percent, but in both cases the gains were smaller than in the two previous months.

Production of consumer goods was unchanged in May and was only 0.4 percent higher than in May 1984. Autos were assembled at an 8 million-unit annual rate, down slightly from April.

The output of business equipment fell 0.4 percent, the fifth consecutive monthly decline. Mining production dropped 0.6 percent, primarily because of weakness in the oil and gas drilling area, the Fed said. Output in mining was 1.7 percent lower than a year earlier.

The report on producer prices showed no indication of any sustained move toward a higher level of inflation, analysts said. Finished-goods prices rose for the third month in a row, and the change over the last three months is the largest increase since the first quarter of last year. However, most of the increase has been caused by rising oil prices, which are not expected to continue to increase.

At the same time, prices for crude goods, such as livestock, coal, crude oil and wheat, fell for the sixth month in a row and were down 8.3 percent over the year.

Prices of consumer goods other than foods and energy rose 0.2 percent after falling a like amount the month before.

In the energy area, where price changes are included in the index with a one-month lag, gasoline prices rose 3.8 percent, much less than the 9.5 percent jump in April. Home heating oil prices went up only 0.4, percent after a 10.2 percent rise the month before. However, natural gas prices, which had fallen two months in a row, increased 4.7 percent.

Separately, the Federal Reserve also said that the amount of installment consumer credit outstanding rose by $8.27 billion in April, a 20.8 percent rate of increase. The rise followed a similar $8.34 billion increase the month before