The producer price index for finished goods was unchanged from April to May, leaving it up only 3 percent in the last year, the Labor Department reported yesterday.

May was the third consecutive month in which the continuing recession kept the index essentially unchanged after seasonal adjustment, but analysts cautioned that even a weak economic recovery in the second half of the year, coupled with rising energy prices, likely will mean renewed increases in the months ahead.

Prices for finished goods, which usually are reflected shortly at the retail level, will rise at about a 5 percent rate for the remainder of this year, according to a number of forecasts. That would mean an increase of less than 4 percent for the year as a whole, a far cry from last year's 9.2 percent climb or the 13 1/2 percent jump in 1980.

The May performance would not have looked quite so good except that energy price changes in the index are routinely shown with a one month delay. A 3.1 percent drop reported in finished energy goods prices for last month actually occurred in April. By May some of those prices, especially for gasoline, were rising rapidly.

In the Washington area, wholesale gasoline prices have risen between 8 and 10 percent since the period in which prices were sampled for the finished goods index released yesterday.

The energy price decline offset other increases, including an 0.7 percent rise in consumer food prices. Consumer food prices had risen 1.6 percent in April but, with declines in five of the last 12 months, that portion of the index is up only 3.8 percent over the year.

Overall, energy prices account for about one-eighth of the total finished goods index and they have fallen more than 11 percent in the last year. However, that figure masks the fact that, while gasoline prices have tumbled 18.3 percent and fuel oil prices 15.7 percent, natural gas prices have gone up 20.1 percent. In the last three months, natural gas prices have risen roughly 2 percent a month, the department noted.

Prices included in the various producer price indexes are those charged by the producer of a product when it is sold. The index for finished goods covers items that are ready for the final user, whether they are sold directly or though some type of wholesaler. The index for intermediate materials, supplies and components includes items such as most steel mill products that will be used to make finished products. The crude materials index covers largely unprocessed items such as crude oil, wheat and iron ore.

The index for intermediate materials edged up 0.1 percent in May after three consecutive monthly declines. The 1 percent increase in this index over the last year was the smallest 12-month change since December, 1967.

At the intermediate level, too, a lag in recording energy-price changes was a factor in limiting the rise in the index. Materials for food manufacturing and animal feeds rose 1.7 percent after a 2.4 percent increase in April. Durable manufacturing materials rose 0.9 percent. But energy prices at the intermediate level dropped 2.2 percent, offsetting most of the other increases.

Crude materials prices rose 2.2 percent on the strength of a 2.7 percent increase in prices for foodstuffs and feedstuffs and a 3.9 percent increase in the nonfood, nonenergy crude materials. Energy materials prices, which in this index are not lagged, rose 0.7 percent following three months of decreases.

Prices for one item especially sensitive to the state of the economy, copper base scrap, shot up 8.1 percent in May. Some analysts saw that as an indication the recession was touching bottom. In recent weeks, however, copper scrap prices have turned down once more.

Prices of iron and steel scrap, which are similarly sensitive, fell 2 1/2 percent in May following declines of 3.9 percent in April and 6.9 percent in March.

Separately, the Commerce Department reported that business inventories rose 0.2 percent in April to a seasonally adjusted level of $508.5 billion. Analysts said the rise in stocks probably was the result of the 0.9 percent decline in sales to a level of $339.9 billion, rather than any intention to add to inventories.

Total business stocks equaled 1.50 months' worth of sales, up from 1.48 in April. Companies have been trying to reduce their inventories to bring them in line with sharply lower sales, and the April figures indicate that process still had some way to go. Reducing inventories requires cutbacks in production that are larger than the drop in sales, and it helps to boost unemployment. When the process runs its course, new orders and production can go up again even if sales do not rise.