Inflation -- judged by many to be the nation's most damaging and intractable economic ailment in recent years--was beaten down dramatically last year.

The final report on consumer prices, released yesterday, showed an increase of only 3.9 percent in 1982 and prompted President Reagan's chief economic adviser, Martin Feldstein, to declare that inflation is now "very much under control."

It certainly has slowed sharply since Reagan took office. In 1980, when he was campaigning for the presidency, consumer prices climbed by 12.4 percent. And for a brief period in the spring of 1980, they soared at an annual rate of more than 15 percent.

Today, if Feldstein is right, the picture is transformed. "There is good reason to believe that we have finally ended the upward spiral of inflation that began in the late 1960s," he said yesterday. Most forecasters, who had not anticipated the speed with which inflation would decline, agree that price rises are unlikely to speed up again this year or next.

However, the news is not all good.

First, the cost of bringing inflation down has been huge. The U.S. economy has been virtually stagnant for three years, unemployment is at a post-World War II high, and it may climb further. It is largely because of the recession--that has swelled the ranks of the jobless and led to lines at soup kitchens across the nation--that inflation has been squeezed down so swiftly.

Most people expect only a weak recovery this year that will leave unemployment high. The reason for the pessimism about growth is that most analysts expect monetary policy to remain quite tight, and still focused on fighting inflation.

Second, the underlying improvement in inflation is not quite as startling as the consumer price figures suggest. For one thing, these tend to exaggerate the effect of changes in mortgage interest rates. While inflation was building up and interest rates were climbing, the CPI overstated inflation. Now the opposite is true.

In addition, a considerable portion of the acceleration in inflation in the late 1970s was due to sharp increases in energy and food prices. These were real enough, and did indeed raise the cost of living for most people. But the effect of the sudden jump in these prices is passing through the system, permitting the inflation rate to slip back again.

Moderate energy and food cost increases worked to hold down the increase in the CPI last year just as they had pushed it up in earlier years. In 1982 energy prices rose by only 1.3 percent and food prices by 2.2 percent-significantly smaller rises than in other prices. But there is no guarantee that this trend will continue in years to come.

Another special and probably temporary factor helping to hold prices down is the strength of the dollar. This has cut the cost of imported goods and thus reduced inflation. However, the dollar already has begun to slip against some other currencies, and most analysts expect it to decline further. While this may be a good thing for American industries trying to compete with foreigners, it will tend to push prices up in future.

Federal Reserve Board Chairman Paul Volcker--who has played the main part in fighting inflation--commented last week that "we need to recognize that part of the inflation improvement reflected unusually favorable food and energy price developments, low commodity prices generally, and more intense price competition from abroad because of exchange-rate considerations." He warned that "we can't count on those factors continuing indefinitely," and added that "we are still far short of price stability."

Volcker was in essence warning that the battle against inflation should not be abandoned now. But many economists say that policy should be directed at boosting the economy now that inflation has been reined in. Unemployment at 10.8 percent last month is now the nation's most serious problem, they say. Lawrence Chimerine of Chase Econometrics commented, "It boggles the mind if there are those kinds of fears" of reaccelerating inflation.