There he is in the photos, aflame with conviction and heady with success: class president, editor on the law review, bold young prosecutor, No. 3 man at the Justice Department, crime-fighting United States Attorney, archenemy of the Mafia, the 107th Mayor of the City of New York. Quite a run!

And now, working from City Hall, Rudolph William Giuliani, 53, has become New York's one ubiquitous figure, hurrying from a burned-out building to a subway derailment to the bedside of a wounded police officer. He is Gotham's action hero, self-cast as the take-charge guy who is reliably among the first at every scene.

By most reckonings, including those of many adversaries, Mr. Giuliani has coupled this celebrity with effective leadership. A seemingly ungovernable city now seems responsive to discipline, its crime rate in a plunge, its tourist-stocked streets palpably safer.

Still, however many his accomplishments, there is something else striking about the Mayor: his temperament. He seems to believe in mayoral infallibility, at least so long as he is the Mayor. To question his righteousness is to risk his wrath. A devil's advocate often seems regarded as the devil himself.

Rudy Giuliani has been described as the best and worst of New York, combining its exceptional talent and its ruthless energy.

This makes for a strange set of paradoxes, for some of Mr. Giuliani's strengths are his weaknesses as well. The adept and decisive manager can be imperious, to the point where surveys show his manner to be his greatest political liability. The candidate who, according to polls, seems headed to an overpowering victory on Nov. 4, can unleash attacks on his opponent that verge on fury. The man with a clear vision of a safer, more livable city can be disdainful of even well-intentioned critics.

''He is a good mayor, but he'll never be a great one,'' said Edward I. Koch, once a committed ally who now says he will vote for him with a reluctant pull of the lever.

''He can't accept disagreement,'' Mr. Koch said. ''When it occurs, he wants to destroy you. He goes for the jugular.''

Despite -- or perhaps because of -- these contradictions, Mr. Giuliani has risen to become the city's most important politician of his generation, a nationally known figure with larger political aspirations.

To understand Mr. Giuliani's rise to City Hall, it helps to have a map of his boyhood and earlier career. Signposts include a Roman Catholic education, doting parents and prominent mentors. Directions come from schoolmates, teachers and colleagues.

The Mayor himself was a grudging participant in this article. For two months, his press office pledged cooperation only to withhold it.

Finally, just before publication, the Mayor agreed to be interviewed. He attributed his wariness to recent articles in several newspapers and magazines about rumors of an extramarital affair, which he has strongly denied. He also complained about what he called unfair political coverage in The New York Times.

Seated in a comfortable armchair in his office, however, the Mayor seemed relaxed and genial. He said he knew all too well that people thought he was harsh and overbearing. But at least on this occasion, such characterizations made him laugh.

''I've been accused of storming out of press conferences that I'd been at for 45 minutes,'' he said with a chuckle. ''Maybe I just had to leave. Maybe I had to go to the bathroom. So I would say, 'That's the last question,' and walk out. The next day it would be written that I stormed out, or that I was bristling. It fits the stereotype.''

Anyway, the perception often works to his advantage, the Mayor added, because when people meet him, they say, ' ''Oh my God, he's very different from what I thought.' ''

Parents

Strong Convictions And Early Instruction

A grandson of Italian immigrants, Rudy Giuliani grew up in richly Catholic surroundings, before Vatican II, with meatless Fridays and the mysteries of the Latin Mass. Goodness, he was taught, required diligence. And his teachers say that young Rudy, more than most, was hard-working and intellectually keen.