If you go retail you have to follow all the government regulations like strick washing and refigeration, and yes you would have to be licenced, You'd have to go to your food safty regulators or program and get the details required for your area. Every place is different.
Ontario Canada would have same or different egg retail regulations then Orlando Florida for example.
As for farmers, or the backyard farmer selling to drive-bys or neighbors, you can do that with out licence. Some towns have bi-laws about road side egg selling, but that would be where every backyard habbiest would be resonsible to check first.
Hope this id a basket full od helpful info