Ever since Social Security was enacted in the 1930s, Republican politicians, including President Reagan last year, have gotten into trouble by talking about changing it.

Now, while most California politicians are storing up energy for the fall campaigns, Gov. Edmund G. (Jerry) Brown Jr. is happily spending his summer trying to make his Republican rival for the U.S. Senate, San Diego Mayor Pete Wilson, the latest in the line. The campaign has gotten rough almost from the start, and it promises to get worse--or better, depending on your taste.

With his personal popularity at a low, Brown has been searching out issues with which he can win back support in constituencies the Democrats have historically considered their own, including the elderly and the disadvantaged.

Then, Wilson told a convention audience in Monterey that he hoped the Social Security system would "differentiate between Americans who are under 45 and those who are older. And with respect to younger Americans, allow them much greater freedom than they presently enjoy with respect to contributing to their own retirement security."

The next day a headline in the Los Angeles Times read: "Wilson Suggests Voluntary Social Security for Workers Under 45." And Brown was off and running, denouncing the idea as "absolutely outrageous" to an audience of cheering labor leaders.

Wilson then denied at an airport news conference that he had proposed that the Social Security contributions of people under 45 be made voluntary.

What he really proposed, Wilson said, was that the mandatory contributions of those under 45 be lowered, thus reducing to a "minimal subsistence level" the benefits they would receive upon retirement. Workers under 45 "still have an opportunity . . . to provide for their retirement income in a different fashion, by IRAs individual retirement accounts or some other means," he said.

Given the fact that Social Security is a potential minefield for any politican, many observers have had difficulty understanding why Wilson gave Brown this opening for his considerable political talents.

But Wilson did not stumble into Social Security. He has been walking purposefully, and publicly, toward it for months.

Wilson talked at a breakfast meeting with reporters last April about reducing the cost of the program by changing the cost-of-living formula. At that same meeting he said he would "prefer" not to cut retirement benefits, but wanted to end the survivor benefits paid to the college-age children of deceased beneficiaries.

Two days before the June 8 primary Wilson described the Social Security system as having been "perverted . . . into a welfare system" and repeated his desire to cut survivor benefits.

Wilson was asked how reducing the Social Security contributions of 60 percent of the work force would help the solvency of the system.

"It's clear that there's going to have to be a greater part played by general taxes," he responded. Admitting that he had not thought out the specifics of this proposal, Wilson criticized Brown for failing to offer his own Social Security plan.

"In the grand Jerry Brown tradition he's facing the crisis only after it's occured," Wilson charged. He also accused Brown of trying to mislead and frighten people with "buzz words."

"That's all he is, is buzz words," Brown said in a telephone interview. "This program he's proposed is a disaster. He's compounding the problem, not solving it. I think it's fine to offer positive solutions, but he's offering a negative solution that jeopardizes the security of millions of California retirees. It's just that simple. I mean, what's he talking about?"

Wilson and Brown have taken the Social Security battle to the airwaves in paid advertising. One Brown ad opens with the recorded voice of Franklin D. Roosevelt, the father of the Social Security program, and an announcer says that "even Republican National Chairman Richard Richards is criticizing his own U.S. Senate candidate, Pete Wilson, because of Wilson's statements on Social Security."

That commercial apparently was produced in response to a Wilson radio ad in which James Roosevelt, the son of the late president and the head of Democrats for Wilson, praises Wilson for "being honest enough to express his ideas for saving the system which is now in trouble."

"My father would be appalled at the fear tactics Jerry Brown is using on this issue," he concludes.