The very act of running was created in terms that we can understand and perform with our bodies, when the first known biped ran to save its own life. Going forward to humans, or, to be more exact, Australopithecus (the early ancestor of humans), they first started running when they were being hunted by predators to save their own life. They most apparently developed the act of running when they started hunting. Finally, running as sport i.e. competitive running dates back as far as ancient times in Greece, Egypt, Asia, and the East African Rift in Africa. You plausibly remember the tale of Philippides and the origin of Marathon. Albeit somewhat of a legend and not an official record, Philippides was tasked to run from the Marathon battlefield to Athens to announce the Persians’ defeat. The name of the customary battlefield served to evoke this glorious run when the very first marathons started to take place.
Taking into consideration the above, you can say that running was “invented” out of necessity.
In 776 B.C., the first episode of the first-ever Olympics Games was a foot race. In 490 B.C., a Greek soldier named Pheidippides is said to have run from Marathon to Athens, Greece—roughly 25 miles—to deliver news of military success against the Persians at the Battle of Marathon. (Not exactly having trained for the extensive feat, the story goes that he keeled over and died immediately afterward.)
In 1896, when organizers for the first-ever international Olympic Games paid tribute to Pheidippides by holding a “marathon” clocking in at 24.85 miles, traversing from Marathon Bridge to Olympic Stadium in Athens. Although only nine out of 25 brave entrants finished the race, it inspired the first-ever Boston Marathon the following year in 1897. It wasn’t until 1908, however, when the marathon was first established as 26.2 miles at the London Olympics. Thirteen years later, the International Amateur Athletic Federation officially declared the marathon to be a 26.2-mile distance.