President Carter, stepping up his personal activity in the administration's anti-inflation effort, sharply criticized Mobil Oil yesterday, accusing it of violating government customers by about $45 million last year.

Carter, clearly making an effort to become more visibly active in dealing with his biggest political problem, made the charge in a hastily arranged speech to a state legislative group shortly after the Council on Wage and Price Stability (COWPS) ruled that Mobil is not in compliance with the voluntary price guidelines.

White House press secretary Jody Powell said the administration is exploring "a number of steps" it could take to press Mobil to rebate the $45 million to its customers by lowering prices.

Sources said COWPS officials will ask the White House to authorize the denial of federal contracts to Mobil in an effort to force the oil company to back down.That power, which has never been used in connection with alleged violations of wage or price guidelines, should be invoked now if the administration's voluntary program is to remain credible, the sources said.

Mobil denied the administration's charge and said the COWPS decision and the president's speech were "patently and obviously political."

The dispute centers on Mobil revenues during the third quarter of last year, which the company concedes exceeded the price guidelines. But Mobil argues that its revenue for the other three quarters, as well as its revenues for all of 1979, were well within the guidelines.

Stung by his losses Tuesday to Sen. Edward M. Kennedy in the New York and Connecticut Democratic presidential primaries, Carter appears to be embarking on a stepped-up schedule of highly visible activities. His criticism of Mobil was made during a speech to a special meeting of the budget advisory conference of the National Conference of State Legislatures.

The president's agreement to appear before the group came on Wednesday, the day after his primary losses and a week after the administration rejected a request from the group that some spokesman appear at the meeting to discuss Carter's proposed new budget cuts.

"It's is difficult for me to understand Mobil's position," the president told the state officials, saying that "most other corporations" were in compliance with the guidelines. He said it is "only fair for the public to know who is not complying."

Carter's signing out of Mobil was a clear case of presidential jawboning directed at a major corporation. COWPS officials later said three other oil companies -- Charter Oil, Crown Petroleum and Murphy Oil -- are also not in compliance with the price guidelines, although they have not been subject to presidential criticism.

Powell said the goal of publicly criticizing Mobil "is to persuade this company to give back to the American people the $45 million-plus by which it exceeded the price standard."

He said Mobil could rebate the $45 million by reducing its gasoline prices by 3 cents a gallon for 90 days, or reducing the prices of all its petroleum products by 2 cents a gallon for 90 days.

The administration initially found Mobil in "probable noncompliance" with price guidelines last month. The COWPS decision yesterday was a rejection of Mobil's appeal of the initial ruling. The giant oil firm currently has $145.1 million in government contracts, almost all with the Defense Department, that could be jeopardized by the dispute.

In his speech to the state officials, the president appealed for support to sustain the new budget cuts that he will formally propose to Congress on Monday.

"You know it is to say no when it would be so much easier politically to say yes," he said."Well, we cannot afford to play politics with the nation's economy or the nation's currency."

Carter conceded that poor people will be hurt somewhat by the budget cuts, but he argued that the poor are also most victimized by inflation. b

He also once again rejected calls for mandatory wage and price controls, which Kennedy says he would impose. Mandatory controls, the president said, "are an evasion of responsibility to cure inflation."