The precise answer is a mystery. It is known that gymnastics were very prevalent in ancient Greece, however the modern sport of gymnastics was credited to Frederich Jahn in the early 1800s.
Ancient Greece prioritized physical activity, with each city housing it's own gymnasium where activities such as running, physical fitness routines and wrestling took place. Regular exercise routines were was continued by the Romans until the Medieval church decided such practices were corrupt and not vital to spiritual health. The resurgence of recreational sports occurred in the early 1800s courtesy of Johann Gutsmith and Frederich Jahn, who created devices to be used in gymnastics. Since Jahn created most of these apparatuses, he is often credited as the creator of modern gymnastics.