Mayor Ed Koch, who once said that life in Albany would be "a fate worse than death," announced his intention to run for governor today, cheerfully saying at a raucous news conference at Gracie Mansion that "everyone has to die sometime."

"I have said repeatedly I never planned to run for another office," said the Democratic mayor, whose second term began only two months ago.

"But over the last several weeks, following Gov. Carey's withdrawal and the Reagan administration's presentation of its 'New Federalism,' I have reconsidered that decision.

"Across this country the action is shifting from Washington to state capitals. Here in New York, counties, villages, towns and cities will have to look to Albany for financial supports, for new directions, and for leadership.

"I believe I can provide that leadership."

Koch, 57, is a tremendously popular politician who was elected this past term with the support of the Democratic and Republican parties, and only last month endorsed two local GOP candidates for reelection.

But he had insisted for years he would not seek higher office.

Today there were repeated questions about Koch's change of heart, with repeated suggestions that the outspoken mayor might be turning his back on the city.

"I quote from one of your favorite prophets, Isaiah," began one television reporter, " 'Thou has forsaken thy people.' "

The comment was a reference to Koch's complaints that the quote from Isaiah on the wall of the United Nations building--the one about beating swords into plowshares--was inappropriate.

"Not bad," said Koch, with the appreciation of one showman to another. But he replied, "You will not be losing anyone; you will be gaining a governor."

His spirits throughout the one-hour conference seemed high, and his comments ranged from one trademark--"That's such a dumb question"--to a sprinkling of "Willya lemme finish?" and two signatures: "Riiidiik-ulous!"

"Will you resign your job?" asked a reporter, "and give the next mayor a better shot at running the city?"

"I certainly will not resign," said Koch, con brio. "Riiidiik-ulous!"

The mayor was asked whether he intended to run an anti-President Reagan campaign, or whether he would avoid criticizing the president "to not chase away any Republican votes."

"Oh, that's riiidiik-ulous," said Koch, who in the past has called the administration's New Federalism "a sham and a shame."

"I will indeed not hesitate to criticize those programs I'm opposed to," he said.

Koch, who was named as the favorite among potential gubernatorial candidates last week in an NBC News poll, declined today to comment on the merits of the competition, which includes on the Republican side state comptroller Edward Regan and on the Democratic side Lt. Gov. Mario Cuomo. He also declined to criticize the incumbent, Gov. Hugh Carey.

Asked if he would seek as a candidate for lieutentant governor a "qualified Catholic for the sake of balance," Koch, a Jew, replied that he would only seek to balance the ticket by "regional qualifications," because both he and state attorney Bob Abrams, who is expected to run for reelection, are New Yorkers.

He also said repeatedly that he felt he could represent all of the state.

"The truth is that not since the Great Depression have the interests of rural New York, urban New York and suburban New York had more in common," he said.