Do you think that every city can function with only the people living in that city?
1) NYC does not have enough housing for all the people who work in NYC, people HAVE to live in the suburbs
2) There isn't enough mass transit to support every suburban area or the volume of people, or even get to every area within NYC
If you live outside NYC, and you work in NYC anywhere outside of Manhattan, it can range from adding a hour each way to adding several hours each way. NYC Mass transit is designed to get people to Manhattan... Another example is if you live in Queens, and work on the other side of Queens, it can take you FOREVER to get to work (trains spider web into Manhattan, not North/South in be outer boroughs).
Also, if you take away farm lands, what will people eat? Where will we put our solar/wind farms? Who's going to services these? There has to be grocery stores out there, medical care,...
People have to live outside Cities, and people have to live in rural areas. The choice is simply if the individual does or not, but society requires it...