THE APRIL SURGE of higher prices is a severe setback to this country in its struggle to bring inflation under control. The price index published yesterday confirms what shoppers had already discovered for themselves: that the rise in food prices accelerated through the winter into midspring. Food bought at grocery stores went up 1.3 percent from January to February, 1.5 percent from February to March, and a whopping 2.4 percent from March to April. One dollar out of every six in the typical family budget goes to the grocery store, and there is no other point in the economy where price increases generate such sharp and immediate anxieties. The White House is now under greater pressure than ever to demonstrate that the country is not headed into another great wave of inflation.

Most of the present trouble in food prices lies in two places, the meat counter and the vegetable bins. Or, to put it more specifically, you could say that it comes down to beef and lettuce. The swing in beef prices is a long cycle, and it has been predicted for several years. The wild jump in lettuce prices, in contrast, is a short-term freak, the result of bad weather. The two have combined to push prices up faster and harder than anyone expected.

The beef market is following a long sequence that began almost six years ago, when the first large American sales of grain to Russia sent corn and wheat prices sharply upward. That made it suddenly much more expensive to feed cattle, and the cattlemen suffered enormous losses. They responded by selling off animals and thinning of their herds as fast as they dared. This process of distress sales has kept beef prices artificially low for the past several years - and, in fairness to the cattle industry, consumers need to keep it in mind that they have been the beneficiaries of those low prices. But now the cycle is approaching its turning point. The cattlemen see it coming, and they are now beginning to hold their animals off the market, to breed them through another generation and rebuild the herds. As the number of slaughtered cattle drops, the price of beef goes up.

It is going up at an unusually rapid rate for a reason that no one fully foresaw: Consumer demand is rising. People are eating more beef. Why? Perhaps it's because incomes are up a little, and American families tend to celebrate that kind of good fortune at the dinner table. The coincidence of lower supply and higher demand is working just about as Adam Smith would have expected.

As for lettuce, you may remember that there were torrential rains in California late last winter. It washed out farmers' fields, and California produces most of the nation's lettuce in early spring. That's why prices went to $1 a head. But the rains have passed, and farms in other parts of the country have come into production. The cost of lettuce, and of fresh vegetables generally, is already falling.

The April surge in food prices currently appears to be slackening. While beef prices will continue to go up, they will go up more slowly as families turn to cheaper alternatives. It will be a little less steak, and a little more chicken and spaghetti again.

The danger, for the Carter administration and for the country, is that a bad attack of inflation can rapidly become self-perpetuating. If people try to recapture the recent erosion of purchasing power through higher wages and profits, a single wave of food-price increases will be transformed into a steady year-around climb in the prices of everything else.

The consumer price index for all items, over the past three months, has been rising at the dismaying annual rate of 10 percent. That's going to make it extremely difficult for the administration to persuade people to keep their wages and salary increases below last year's levels. It will be a test, not only of the leadership of the people who work at the White House, but of the good sense and public spirit of all the people who work everywhere else.