The U.S. Department of Energy yesterday gave up on trying to require retail gasoline stations to post their profit margins and maximum selling prices.

A rule that the department had established two weeks ago would have made it mandatory - effective today - that most of the nation's 171,000 service statons post profit and maximum ceiling price information so that consumers and federal enforcement officials could determine at a glance whether dealers were complying with federal price controls.

However, the rule has aroused widespread opposition from retail dealers, who have threatened strikes and protests.

So, yesterday, the Energy Department published a new rule saying that instead of posting their profit margins and ceiling prices, dealers can promise in writing that they are complying with price controls.

"They have emasculated entirely the principal purpose of the new regulation, which was to make visible, not only to the public but also to enforcers, information that would enable him to determine whether dealer is charging more on his pump face than he is obliged to," said Dan Lundberg, publisher of the authoritative gasoline station pricing survey that bears his name.

The Energy Department's official explanation for making the concession to the retail dealers was the the posting of profit and price information would "allow competitors to determine what a dealer is paying for gasoline . . .(and) would facilitate predtory pricing practices by competitors."

However, in an interview last Friday, the Energy Department's number two regulatory official, Douglas G. Robinson, said that the dealer objections were largely along the lines of "it is un-American to post [profit] margins."

The rule changes that become mandatory today establish for the first single gross profit margin of 15.4 cents for dealers who own their own stations and operate either under the name of a major oil company or a private brand.

These are the so-called independent dealers who represent three-quarters of the service stations nationwide. An other 40,000 stations are owned and operated directly by the oil companies.

The price and profit posting requirements for independent dealers might also have been extended to refinery-operated stations had energy officials not dumped the idea yesterday.

The new pricing rules would require these stations to charge no more than 15.4 cents above the wholesale price to the nearest independent stations competitor.

Federal energy officials said the intent of the new rule is to prevent refinery-owned stations from charging higher price during gasoline shortages.

However, the reaction among gasoline dealer associations was highly critical. "The problem is that the 15.4 cents [ceiling] is not an adequate margin to being with," said Risque Harper, spokeman for the 60,000-member National Congress of Petroleum Retailers.

Harper said up to 2,000 members of the association will protest the rule change in demonstrations today at the White House and the Capitol.

The strongest critcism from independent dealers is that the new rules give refinery-operated stations the upper hand inpricing during times of plentiful gasoline supplies. Refinery-operated stations will continue to price their products under separate pricing regulations that apply to refiners. Harper argues that under those rules, refinery stations are charging profits and, therefore, ane "locked in" to a 5-cent advantage over independent stations, whose average profits are close to the 15.4-cent ceiling.

"It's bad enough to have these guys [refiners] competing with dealers in the first instance," said Harper. "On the one hand they have the ability to set high wholesale prices that dealers cannot escape and on the other hand they have the ability to price low at retail because they are big corporations getting profits from other sources and this has been going on since 1974."

Middleman gasoline distributors also will be covered by the dual-pricing system that applies to refiners. These middlemen are called jobbers in the industry and a spokesmen for the national Oil Jobbers Council enchoed Harper's contentions yesterday and added, "Consumers may think they're getting a pricing break with the new . . .rules, but that's a lot of bunk."

The spokesman, Allen Darrow, said, "The consumers won't benefit because the rulings also allow additional charges for service like window washing . . .Also, many stations won't have to accept credit cards under the new rulings.

Energy regulatory official Robinson generally acknowledged that should plentiful gasoline supplies return, refinery stations would have an advantage over independent dealers. However, Robinson said the department has requested industry comments on future rules that would eliminate that unfair advantage before plentiful supplies return.

Robinson said the more "immediate problem" faced by the department under the rules effective today was eliminating the possibility of refinery stations' being able to collect greater revenues during the tight supply market that has gripped the nation since May.

The new rules effectively eliminate for refiner and independent stations the passing on of "banked" profits. Under the Energy Department's banking rules, retail stations have been able to charge consumers for profits not taken during lean, competitive years. This had the effect during the shortage of prices rising much faster than actual crude oil cost increases as dealers rushed to recover deferred profits while demand was high.

The National Governors Association renewed its criticism of a provision of the new rules that would allow the governors to adjust the profit margins of service station operators by 75 percent for hardship reasons.

Under this provision, Washington Mayor Marion Barry, or the governor of any state, could unilaterally raise gasoline profits 10 cents a gallon if he determined that the dealers were suffering economically.

Last Thursday, Indiana Gov. Otis Bowen and Colorado Gov. Richard Lamm demanded in a letter to the Energy Department that this new state authority over prices be rescinded.

The governors argued that the states are not equipped to become gasoline pricing regulators and they called the proposal "bizarre . . .probably illegal and unmangeable."

Implicit in their critism was the reluctance by the states to come between and balance the interests of consumers and plitically powerful retail dealer associations.

"To shuffle off the politically unattractive parts of the system," said George Liebmann, energy adviser to Maryland Gov. Harry Huges, is not acceptible to the governors.

It was difficult to determine the immediate impact of the new pricing rules on the 1,500 service stations in the Washington area.

"I'm raising everything about two cents," said Ben Simpson, owner of Capitol Hill Gulf at Second Street and Massachusetts Avenue NE. Simpson added that he is still not satisfied that dealer profits are high enough and, he added, he is "tempted to start charging separately for service."

"It's going to hurt me, it's dropping me down three cents," said Ralph Nutnez, who operates a Gulf station in Virginia at 6528 Little River Turnpike.

Meanwhile, a number of major oil companies announced price increases yesterday. Amoco, the second largest retail supplier in the Washington area, upped its prices 2 cents across the board effective midnight last night. Crown also raised its prices 2 cents a gallon across the board while Standard Oil of Ohio raised its prices 3 cents a gallon.

Texaco announced a 1-cent increase. CAPTION: Illustration, New Maximum Local Gas Prices, The Washington Post