Annie Hall was wrong. Coming home to live here after 15 years, I submit that New York is not dying, that it's as exhilarating, diverse, challenging and rewarding as ever.

The city has changed in many ways, of course, and most are not for the better. It requires patience and stamina to live here, but then it always did. The point is that New York still gives back more than it takes, that while it is expensive and dirty and often turbulent, it is never dull.

Consider what happened one evening when we returned to our neighborhood, Cobble Hill in Brooklyn, from an all-day fair just across the river at Battery Park, where the children had watched the puppets and clowns and musicians while we looked at the Statue of Liberty and at ships setting out across the harbor.

Still wearing the "I Love New York" button someone had pinned on me at the fair, I went to the corner grocery for bread and milk. I pointed at some baseball-sized white objects floating in liquid in a pan on the counter and asked, "What's that?"

The grocer rolled his eyes heavenward. "What's that?" he sneered. "'I Love New York' you're wearing and you have to ask what that is? It's mozzarella. We make our own. All pure. No salt. No preservatives."

He was right to chide me. New York is still the ethnic capital of America, and the customers are expected to know the mozzarella from the feta.

Italians, Poles, Latins, Jews, Russians, Arabs, Chinese, Greeks, Koreans, Irish -- all have their own communities, and all seem to have their own groceries, restaurants and even newspapers. No matter how many New Yorkers move to the suburbs, the great ethnic concentrations remain and new ones appear. I was surprised to find bearded, black-clad Hasidic Jews still walking the mean streets of Williamsburg, but even more so to see that a movie theater in Rego Park, the heart of Jewish Queens, is now the Bombay Cinema, showing films in Bengali.

Our neighborhood, last in the news when mobster Joey Gallo was blown away just down the street, is mostly Italian. You can tell not just from the language but from the men in sleeveless undershirts sitting in their "social" clubs, from clannishness of the mothers who refuse to let their children play with ours because they don't know us, and from the smells drifting out of D'Amico's, where they roast their own coffee, and Pastosa's, where they make their own ravioli.

But we have Arabs, too, with Yemeni, Moroccan and Lebanese restaurants nearby and a family of Palestinians from Jerusalem who run the hardware store. The four men who painted our apartment spoke to each other in Polish, and my daughter's dedicated and demanding teacher at P.S. 29 is Carmen Farina, who lives around the corner and sometimes gives Spanish lessons.

The public school system, which turned millions of Ellis Island immigrants into educated Americans, is now in terrible shape, with low test scores and high dropout and crime rates competing for attention. That seems to be partly because whites have lost faith in the schools, which are about 70 percent black and Puerto Rican, and partly because the budget has been slashed in the city's lingering fiscal crisis. The crisis was brought on by the city's traditional generosity to its residents, who had more free libraries, parks, bridges, museums, colleges and hospitals than those of any other American city, and all those services have declined as the price of operating them has risen.

That decline has pushed many middle-class families out to the suburbs, but most have remained, demonstrating their resourcefulness and attachment to what New York gives them.

These people -- O'Henry's "Four Million," now just over 7 million -- are the great majority of New Yorkers, neither jet setters nor dope pushers, but working people with families who grew up playing stickball in the schoolyards and rooting for the Dodges or the Mets, people whose parents slept on the fire escapes on hot summer nights.

Some are poor and live in old apartment buildings where the garbage goes down on dumbwaiters and the hallways smell of food. A surprising number are middle class, both white and black, and live in sturdy, suburban-style houses on the tree-lined streets of Queens. Either way, most are honorable, anonymous people who ride the subway to work and will never go anywhere near Studio 54 or the 21 Club, where they are spurned as "bridge and tunnel people" or "BBQs," for Brooklyn, the Bronx and Queens. The movie about them was not "The Other Side of Midnight" or "Manhattan" or even "The Blackboard Jungle," but "Saturday Night Fever."

Out in Flushing, Queens, where I lived as a teenager, I found that a left turn at Kaufman Carpers, past the bagel bakery, still leads into the tidy streets of row houses and garden apartments where I used to deliver the Long Island Press. The Press has gone the way of the Daily Mirror, but the neighborhood remains.

Cut off from New York for so long, I had lost the feel for it as a city of neighborhoods, a city more diverse and less well known than theatrical, French restaurant, snob-appeal New York or the New York of tenements and drugs on the streets and the kind of monsters who push people like Renee Katz under subway trains.

Miss Katz, a talented high school music student, lost a hand when someone pushed her off a subway platform into the path of an oncoming train during the rush hour one morning last spring. Her hand was reattached in a marathon operation, though it is said to be unlikely that she will be able to resume her musical career.

But there is another side to the shocking, random violence of her story that tell something else about New York. Months after the incident, the police arrested a suspect and said they had cracked the case with help from concerned New Yorkers who had called in with tips and had cooperated with the investigation.

While New Yorkers are inured to violence and exhibit a carefully cultivated inability to see what they do not wish to see, they can still be moved to outrage and grief when it goes too far, as it did in the Renee Katz case. Their collective sense of decency has survived. The hoodlums who push people under trains or throw little boys off the roof or shoot old women for a few cents are as much an aberration here as they are the many other big cities where such things happen.

New York could not survive, its people could not live and work in relative harmony at such close quarters, if the city were as bad as its reputation. Of course the South Bronx is a nightmare, but that apparently has reinforced the determination of the millions in the surviving communities, in the tract houses of Bayside and the row houses of Staten Island and the apartments of Yorkville, to stop the blight from spreading.For every area of the city that has fallen apart since I left, there seems to be another making a comeback.

Still, there is no disguising the racial animosity and division that have developed in the years since I was a boy on the streets.

White cab drivers are forthright in their reluctance to pick up black fares. White shopkeepers rig up buzzer systems that permit entry only to desired customers, which does not mean black customers. Crosses have been burned in front of houses purchased by blacks in white neighborhoods. Mayor Edward Koch, who was unequivocal in his condemnation of the cross burning, has himself been denounced as a "racist" because one of the city hospitals he wants to close serves East Harlem.

I had thought that the greatest failure of Mayor John V. Lindsay's administration was the inability to protect relatively unspoiled Staten Island from the ravages of indiscriminate development when construction of the Verrazano Bridge made that borough accessible to the rest of the city. But I was quickly disputed by a friend of Italian origin, who said that "the reason we hate Lindsay is that he gave this city away to the blacks. He just surrendered it."

There seems to be a lot of that feeling around, a lot of overt animosity among whites and blacks and Puerto Ricans, and it prompted changes in the way life is lived here.

As a boy, for example, I occasionally rode my bicycle from Queens into Brooklyn to Ebbets Field. That long trip took me through neighborhoods that were mostly black, but nobody suggested that I would encounter any hostility there, and I didn't. Today, my New York friends assure me, it just isn't done, any more that they would go to Harlem to the jazz clubs, as white New Yorkers used to do.

In a telling symbolic gesture, the residents of two white neighborhoods in Queens that had always been served by post offices across the line in Brooklyn voted to change their zip codes to numbers in Queens because, they said, their friends were afraid to visit those zip code areas and they no longer wanted to be linked in any way to the blacks on the Brooklyn side.

Here again, however, the news is not all bad. Black, white and Puerto Rican New Yorkers by the hundreds of thousands work, shop, travel the subways and play in the parks side by side every day, in tolerance if not always in friendship, and for every cross-burner there are two community workers promoting racial harmony. The racial gang wars of "West Side Story" are long in the past. There are some integrated neighborhoods and integrated schools. Whites, blacks and Puerto Ricans worked together in trying to save Brooklyn Jewish Hospital, bankrupted by the cost of caring for the destitute and for the illegal immigrants.

That's the enduring nature of New York and part of its attraction. Contrast and unpredictability prevail.What's true on one street is not true on the next. This is perhaps encapsulated by Manhattan Plaza, a luxury apartment project at 42nd Street and 9th Avenue, just west of Times Square, one of the sleaziest areas of town.

Tennessee Williams lives there, and most of the residents are in fact actors, writers and stagehands whose rents are subsidized and who can walk to the great Broadway theaters nearby. But that short walk takes them through a jungle of narcotics and pornography, along streets where bands of aggressive transvestite prostitutes solicit business. It's too soon to say which group will drive out the other.

The construction of Manhattan Plaza, and of the vast Co-Op City apartment project where the Freedomland Amusement Park once cluttered up the Bronx, the opening of the World Trade Center and the third Madison Square Garden, the development of Roosevelt Island and even the virtual demolition of the South Bronx and East New York, all since I left, are convincing evidence of the city's dynamism, of its continuing ability to evolve physically while retaining its unique nature.

I regret the disappearance or decline of institutions we took for granted: Four newspapers are gone, Stern's Department Store gave up, the Giants play in New Jersey and Rogers Peet, once the rival of Brooks Brothers, now sells two-pants suits for $90.

There are neighborhoods I frequented years ago where I wouldn't want to spend much time now. There are bars in Greenwich Village where I no longer would be welcome because they belong to the gay community. Only one Automat remains. But there are new neighborhoods and other bars and plenty of low-cost restaurants that are better than the Automat ever was. New York has its ailments, but I'm happy to say the obituaries were premature.