Keeping chickens for egg production in an urban setting is rarely a money making thing. By the time you build the facility to house them, buy the hens, feed and water them until they're of egg-laying age and condition, plus clean up after them, you've spent plenty. A typical hen lays one egg a day, sometimes every other day, sometimes every three days. If you're feeding a family, you'd need to have enoiugh hens laying regularly to keep your family supplied. But even then, you'd likely have to wait awhile until the hens are ready to lay for you - presuming no illness or night-time coop raiders.
To my mind, that's a lot to go through just to have a few eggs at home. Easier to let the commercial producers supply them, as they can. I bought a two-dozen pack at Costco the other day for $8. So even at $4 a dozen, it's not as outrageous as it might have been. Better than spending $8 at Starbucks for a fancy coffee drink.
Dave