President Reagan said last night that the United States is prepared to respond militarily if there is proof linking Libya to the terrorist bombing of a discotheque in West Berlin, as U.S military planning continued for a possible retaliatory strike.

At a nationally televised news conference, Reagan referred to Libyan leader Muammar Qaddafi as "this mad dog of the Middle East" but stopped short of saying there is definitive evidence tying Libya to the discotheque bombing, which killed a U.S. Army sergeant and a Turkish woman and left more than 50 Americans among the injured.

". . . We're continuing with our intelligence work and gathering evidence on these most recent attacks . . . ," Reagan said. "And any action that we might take would be dependent on what we learn." Later in the news conference he said, ". . . If there's identification enough to respond, then I think we respond."

The president, who declined to confirm reports that he has ordered a retaliatory strike, was less definite in his link of Libya to the terrorist bombing than other U.S. officials had been earlier in the week. On Monday the U.S. ambassador to West Germany, Richard R. Burt, said there was "very clear evidence" of Libyan involvement.

While the president was laying down the conditions for a U.S. military response, administration officials said planners at the Pentagon, Central Intelligence Agency and White House continued to review U.S. military options for retaliation against Libya. The possibilities of using Navy bombers from carriers off Libya, Air Force F111 bombers stationed in Britain and B52 bombers stationed in North Dakota have been studied.

Officials said the Defense Department is holding two aircraft carriers in the Mediterranean to keep open the option of a retaliatory strike against Libya. One was the USS Coral Sea, which had been scheduled to leave the Mediterranean this week and begin a return voyage to its home port at Norfolk, arriving in late April.

The USS America also remains in the Mediterranean. With the two carriers, the United States has about 175 fighters, bombers and electronic warning aircraft for use in any operation against Libya.

In the massive exercise last month in the Gulf of Sidra, bombers from these carriers and the USS Saratoga attacked the Libyan antiaircraft site at Surt in response to a missile attack. The Pentagon now says that radar was temporarily knocked out at Surt, that two Libyan patrol boats were destroyed and that three others were damaged.

In a news conference in the East Room last night, Reagan defended this naval exercise, denying that it was "a deliberate provocation" of Qaddafi. The president said that "even the Soviet Union" recognizes the Gulf of Sidra as international waters and that the United States had staged naval maneuvers there many times before.

Reagan made his comment in response to a question about whether, when ordering the Gulf of Sidra operation, he had considered the possibility that American lives might be lost. The president said this decision was "the most difficult thing to do" but that there are times "when people have to be endangered, but not idly and not just for a provocation."

Last night Reagan appeared to be walking a verbal tightrope when he simultaneously put Qaddafi on notice and declined to say that he had incontrovertible evidence of Libyan involvement in the West Berlin bombing. Asked about a reported electronic interception of a congratulatory note from Qaddafi to the Libyan People's Bureau in Berlin, the president declined to comment "on anything that can reveal where we're getting information."

In response to a direct question about whether he has ordered retaliation, Reagan said this was asking him to comment "about battle plans" and refused to answer. He went on to say that "what we're trying to do is to find out who's responsible for a fine sergeant in our military dead and 50 young Americans lying in a hospital wounded because of that dastardly attack in West Berlin."

Earlier in the day, Reagan told a convention of newspaper editors here that Qaddafi is "definitely a suspect" in the bombing of the discotheque and warned that the United States is "not going to just sit here and hold still" while terrorist attacks against Americans continue.

At the same time, Reagan claimed progress in the fight against terrorism, telling both the editors and the news conference audience that 126 specific acts of terrorism had been aborted last year because of administration actions and international cooperation.

The president defended his confrontational attitude toward Qaddafi, responding to a question from a reporter who quoted former president Jimmy Carter as saying that Qaddafi is a polecat "and you don't poke a polecat."

Reagan said that failure to confront a terrorist could encourage further acts of terrorism and that "everyone is entitled to call him [Qaddafi] whatever animal they want, but I think he's more than a bad smell."

In his other comments about Libya last night, Reagan said the administration will be alert for further terrorist actions and does not overlook the possibility of a Libyan-inspired terrorist attack within the United States. He said Qaddafi has "a goal of world revolution, Muslim fundamentalist revolution" and that the United States has been singled out "more and more for attack."

But despite the apparent U.S. willingness to retaliate against Libya, administration officials acknowledged last night that the proof that the president has laid down as a condition for military action had not been produced.

Much of the evidence comes from the kind of intercepts of Libyan communications that the president declined to discuss last night, sources said. But they said the U.S. intelligence community is reluctant to circulate its findings for fear Libya will take countermeasures to frustrate electronic intelligence planning.

In the continuing U.S. military planning for a possible retaliatory strike, action from carriers in the Mediterranean has emerged as a favored option. Sources said this is because British Prime Minister Margaret Thatcher was approached about the possible use of F111 bombers based in her country to attack Libya and was cool to the idea.

Reagan was also asked last night whether he had avoided mentioning possible targets for U.S. action in Syria because the United States wants Syrian assistance in securing the release of six U.S. hostages held in Lebanon. The president replied that "we'll go wherever the finger points" but said "the leads" in recent events have not shown Syrian involvement.

The president said the safety of the hostages would be "a great consideration" for him in approving any operation -- but not necessarily the determining consideration.

"But again, we have to deal with this terrorist problem," he said. "We cannot allow terrorists to believe that they can do this to the world."