These are painful, trying days for John B. Anderson. His resolve and political fiber are being tested as never before.

He has fallen sharply in the polls, those fickle yardsticks by which politicians live and die. He is short of money. The boost he had hoped to get from the presidential debate 10 days ago never came. Political obituaries are reappearing.

One of his few nationally known supporters, George Ball, jumped ship the other day. And the Carter administration has launched a fullscale offensive to force him out of the race.

With less than five weeks remaining before election day, Anderson strategists are not sure how to reverse the slide. And it is not certain the candidate would take their advice if they had any to give.

The candidate, a stubborn man who does not suffer fools lightly, faced the same situation last spring in the Republican primaries. Then, he abandoned his party, and launched his independent bid for the presidency.

Now, the Illinois congressman has no such way out. So he keeps plodding foward, as if one more speech, one more television interview, one more brave pronouncement, will somehow turn the tide.

His campaign has become a potent human drama, a test of inner strength and personal dignity. So far, Anderson is performing well, playing the aggrieved martyr, the victim of political circumstance and chicanery.

He dismisses calls from Vice President Mondale that he withdraw from the race as "wholly gratuitous" and a sure sign that he has the president on the run.

"I'm not about to get out of the race," he declared here Tuesday night, his voice swelling with passion.

He ridicules suggestions that he is a "spoiler," a guy who can't win the presidency himself but can keep Jimmy Carter from winning. Tuesday, during what will probably be his last visit to the South before Nov. 4, a campaign worker in North Carolina gave him a newly printed bumper sticker. It said, "A vote for Anderson is a vote for Anderson."

The congressman held the red-and-white bumperstrip aloft like a crusade banner when he arrived here. "A vote for Anderson is a vote for Anderson," he proclaimed. "It's not a vote for Ronald Reagan. It's certainly not a vote for Jimmy Carter. That will continue to be the message of this campaign."

Today, after flying to Denver, he delivered a blistering attack on Carter's political operatives, declaring that "by what they are saying and doing, they are admitting at last that the president can no longer win the election, that . . . it is now clear President Carter is no longer the alternative to Ronald Reagan. And before that notion gets abroad in the land the Carter camp is making one last maneuver to obstruct the real alternative to Ronald Reagan."

He said he wasn't "shocked or even surprised" at the moves by the president's operatives because it fits into "a pattern of obstruction that has been going on for months."

But the question remains: what can Anderson do to get his longshot candidacy, now attracting only from 9 to 14 percent of the vote in national polls, off dead center? Or as Carter's pollster and strategist Pat Caddell said the other day, "If he is unable to get a boost from the debate with Reagan, where can he get a boost?"

"We need a couple of breaks and we've got to play for them," press secretary Tom Mathews said with a shrug today. "You stay in the game because you never know when two pair can become a full house."

The Carter camp is playing its hand hard again this week. The message has gone out on all the formal and informal political circuits. "The big story is Anderson is flat and falling," says Carter campaign chairman Robert Strauss. "He's been dead for months. He's going to go down now," Caddell adds.

"Mr. Anderson said repeatedly, not once but several times, that if the only function of his campaign is to help Ronald Reagan, that that would be such an intolerable result that he'd get out," Mondale told NBC-TV. ". . . he's got to reflect and ponder whether that time has come."

In addition, the Carter' campaign has begun airing anti-Anderson ads for the first time. "Without question a vote for Anderson will help boost the other Republican, Ronald Reagan," one ad says. Another commercial questions Anderson's credentials as a liberal and suggests he has an antilabor voting record. "A presidential candidate so difficult to bring into focus may not be exactly the right man for the Oval Office where consistency is vital," the ad says.

This is the same tactic Carter used on Edward M. Kennedy during the fight for the Democratic nomination. Isolate the opponent. Question his motives. Proclaim he has no chance of winning. Use innuendo to suggest he is on some sort of foolish, kamikaze effort.

Privately, top Carter and Reagan strategists say they don't think Anderson, after 15 months on the stump, would quit now. But the reason for Carter's fears about the independent are clear.

Caddell's polling indicates that while Anderson didn't gain overall support from his appearance in the debate, the composition of his support has shifted. He lost some support from suburban Republicans to Reagan, and picked up support from liberal Democrats.

"Too early to write Anderson off," says James Baker, Reagan's deputy campaign chairman. "He may drop some more, but you have to remember in 1976 Gene McCarthy got only 2 percent of the vote and he cost Carter Iowa, Oregon and maybe some more states."

Anderson has no money for ads to counter the attacks. He has been trying to negotiate a multimillion-dollar loan ever since the Federal Election Commission four weeks ago ruled he would be eligible for retroactive public campaign subsidies if he gets 5 percent of the vote or more. But so far he hasn't succeeded in getting any loan.

Anderson's money-starved campaign is now soliciting "loans" by direct mail, and the candidate says he will repay them with 8 percent interest, after the election.

"Would you be willing to lend $50, $75, $100 or more, to be repaid after Nov. 4, when I qualify for federal funds? I'll repay you in full when I receive enough federal funds. If the total federal funds are insufficient to meet all my obligations. I will repay you on a pro rata basis," the letter says.

This leaves the campaign with one asset -- the candidate. His performances during the last five days have been among the best in his campaign. At alternate points, he has been angry, evangelistic, impossibly boring, futuristic, feisty, presidential and even humorous.

For those who doubt his chances, or have turned against him, he says he's afraid they are "being affected by a virus that is being unleashed by the Carter campaign. It's a virus that affects people so they lose what ought to be their political judgement . . . there's always going to be some sunshine patriots and summer soldiers."