If we consider answering this based on evolution we can say that chicken came first before the eggs. When prehistoric birds mate there will be DNA mutation thus forming another type of creatures until the new world chicken is produced. Chickens are found to be the ancestors of the red junglefowl hybridized with grey jungefowls which means that chickens have been a product of mutation due to certain factors (chemical, physical, climate, geographical etc...). Now we can be looking at the question, which came first: egg or junglefowls? If we trace this genealogy, we can see that historically, birds originally give birth alive. The evolution of the formation of the eggshells is in the process of proteomic (protein researches).
lets take the question logically, if an organism evolve out of the surface of the earth it would have to think of how it could survive. considering that there is no clear account of what came first you must ask yourself could an egg protect itself from other species? or could it thrive to gather energy from food source? after knowing the answers you will know.