The nation's unemployment rate rose sharply again in May from 7 to 7.8 percent of the work force, the highest in 3 1/2 years, while inflation at the wholesale level slowed to annual rate of less than 4 percent, the government reported yesterday.

It was the second consecutive month that unemployment has jumped nearly a full percentage point. The increase occurred all across the economy. nIn all, about 8.2 million persons were out of work.

At the same time, the Labor Department announced that prices charged by producers rose only 0.2 percent in May, the least since September 1977, and a dramatic sign that the inflation rate is coming down in response to the recession.

The continued sharp rise in the unemployment rate appeared likely to heighten political pressure on the Carter administration to switch policies. The White House so far eschewed proposing any tax cut to fight the recession.

At 7.8 percent, the jobless rate was back where it stood in November 1976 when Carter defeated president Gerald R. Ford, partly over the economic issue. Carter then called the jobless rate "unacceptably high."

But yesterday, in remakrs to a group of state Democratic party chairmen, Carter conspicuously played down the unemployment situation and instead emphasized the newest improvement in the inflation figures.

In an upbeat speech in the East Room, the president declared that "we've turned the corner on inflation." He later acknowledged that the recession was "a serious problem," but avoided any mention of the 7.8 percent jobless rate.

Meanwhile, Carter's chief economic spokesman, Treasury Secretary G. William Miller, while acknowledging the seriousness of the jobless figures, said at a press conference, "We do not know the path of the economy from here, and until we have that in mind, we don't intend to flinch."

The figures on producer prices brought inflation at the wholesale level last month to an annual rate of only 3 percent, down from a 6.2 percent pace in April and a staggering 21.3 percent annual rate in January.

Although improvements in producer prices do not always result in dollar-for-dollar changes at the retail level, Janet L. Norwood, commissioner of labor statistics, predicted there would be "continued deceleration" in the consumer price index.

However, Charles L. Schultze, chairman of the Council of Economic Advisers, cautioned that "I wouldn't want to suggest that increases of 0.2 percent and 0.3 percent a month can be counted on" for very long. Most economists expect inflation to settle around a 9 percent rate by the end of the year.

The rise in the jobless rate so far this year has been far greater than the administration officially predicted. The White House last estimated that the unemployment rate would reach 7.2 percent by the year's end.

Miller told reporters yesterday the administration is counting on "seal-healing characteristics" in the economy -- such as falling interest rates and a declining inflation rate -- to reverse the recession.

He also called for further cuts in the prime lending rate of banks, which has plunged to 13 percent after peaking at 20 percent in April.

The grim job picture nationally contrasted sharply with the government-dominated job situation locally. New figures showed the jobless rate in the District actually declined in April to 6 percent, from 6.6 percent before.

The unemployment situation around the rest of the nation was mixed, with the jobless rate ranging from 14.4 percent in Michigan last month to 5.4 percent in Texas, unchanged from April's level.

The rise in the jobless rate was spread among virtually every major category of workers. The unemployment rates for adult men and women jumped to 6.6 percent in May, from 5.9 percent and 6.3 percent respectively the previous month.

The jobless rate for teen-agers leaped to 19.2 percent, from 16.2 percent before. The unemployment rate among black teen-agers rose to 35.2 percent in May, from 29.8 percent in April -- amounting to about 373,000 young people.

As has been the case in previous months, a substantial portion of those out of work were in the hard-hit auto and construction industries. The jobless rate among auto workers last month was 29 percent.

But layoffs in other industries pushed unemployment up in virtually all major sectors of the economy, with laid-off persons accounting for more than half of those unable to obtain jobs.

The total number of jobs in the economy declined during May by 166,000 -- far less than the 502,000-job drop in April, but still significant. 1Industry payrolls shrunk by 180,000 jobs.

At the same time, the number of new job seekers in the economy soared by 723,000, almost three times the usual monthly increase, possibly reflecting a rush of college students into the summer job market.

Government technicians said the influx of students may have bloated the unemployment rate somewhat. The jobless survey was taken earlier than usual this time. The students usually aren't counted until the June employment survey.

The improvement in the producer price index reflected a variety of factors: Energy prices slowed markedly in May, rising 0.8 percent, compared to a 3.8 percent jump in April; prices of capital goods remained stable in May.

Food prices edged up 0.1 percent after plummeting in three of the four previous months -- a harbinger of possible sharper price hikes later. Wholesale prices of other goods consumers usually buy rose 0.3 percent -- a fifth their previous pace.

However, there were some of adverse developments on the price front that could affect producer prices in coming months. Prices of foods and feeds at intermediate stages of processing surged 6.1 percent. And crude prices jumped 1.3 percent.

The May increases brought the overall producer price index to 241 percent of its 1967 average. That means it took $241 to buy the same goods at wholesale last month that cost $100 about 13 years ago.

Over the past 12 months, producer prices have risen by 13.3 percent. By comparison, the 12-month rate at this time a year ago was 10.2 percent.