Federal agents who had John W. Hinckley Jr. in their custody hours after he shot President Reagan last March 30 testified yesterday that Hinckley willingly provided information about himself and his activities up to the point when he arrived in Washington. But they said he would say nothing further without a lawyer present.

During a hearing yesterday in U.S. District Court, the agents said that Hinckley was advised repeatedly of his constitutional right to have a lawyer present while he was being questioned. At Hinckley's request, the agents said, they agreed they would not ask him for details about the shooting incident, but would seek only background information.

Hinckley's defense lawyers contend, however, that Hinckley told a D.C. homicide detective within an hour after his arrest that he wanted to talk to a lawyer before he said anything to law enforcement authorities. The defense lawyers contend that any questioning of Hinckley after that point was illegal. They want Judge Barrington D. Parker to prohibit the government from using as evidence at his trial any such statements that Hinckley made. The trial is scheduled to begin Nov. 30.

The prosecution contends for its part that Hinckley waived his right to have an attorney present during questioning that was limited to his background. The prosecution also argues that such limited questioning of Hinckley did not amount to the kind of police "interrogation" that the U.S. Supreme Court has prohibited unless a suspect has clearly waived his right to have a lawyer present.

U.S. Secret Service agent Stephen T. Colo testified yesterday that he sought background information from Hinckley to help determine quickly whether others were involved in the shooting or if other persons were in danger. Hinckley, whom Colo described as calm and articulate, went into "remarkable detail" about his travels from city to city during the year before the shooting, Colo testified.

At one point, Colo said he asked Hinckley if he had a girlfriend after Hinckley commented that television coverage of the shooting was "too bad because this is going to affect other people."

Hinckley responded,"Yes, I have a girlfriend, but it's not really a girlfriend because it's a one-sided relationship," Colo testified. Colo said Hinckley then identified the girl as actress Jodie Foster and said a number found in his wallet, along with a picture of Foster and a John Lennon button, was for a telephone in her dormitory at Yale University, where she is a student.

Law enforcement officials, who found an unmailed letter addressed to Foster in Hinckley's hotel room on the day of the incident, believe Hinckley assaulted the president in an effort to impress Foster.

Parker has not ruled on a defense request to prohibit use of Hinckley's statements.