If memory serves, bread has been known since prehistorical times, and wheat already has been grown in the area of Mesopotamia and Egypt since the Neolithic. Seeing how it allowed what used to be hunter-gatherer societies to perform agriculture and thus played a vital role in shaping the first few civilizations, I suppose that it simply spread outwards to Europe, (eastern) Asia and Africa from the fertile crescent. Perhaps the Asians that passed the Bering strait to colonize America may have brought the recipe with them, although this probably is a very shaky theory. It might as well have been an independent discovery.
As to how people discovered it - I'd imagine it mostly was per chance. Early humans regularly ate plant seeds (and whatever else they could come up with) as part of their diet. Maybe some of them crushed the seeds in an attempt to get rid of the harder shells, and then added water to the resulting flour to create an edible paste.
Yeast spores necessary for the fermentation of the dough occur virtually everywhere on the planet, so if you simply leave the dough be, it will ferment sooner than later. At this point, all they had to do was to roast it over a fire, and bang, you get the first basic version of bread.