The school gym carries an awkward secret in its name. The Greek word behind it means "naked."
Greek gymnos meant naked or nude. The verb gymnazein meant to train naked, and more broadly to train or exercise. From it came gymnasion, a public place for physical exercise. Merriam-Webster gives the chain as Greek gymnasion, from gymnazein, "to exercise naked," from gymnos.
The name was literal. Wikipedia's article on the ancient Greek gymnasium describes athletes who undressed, trained naked, oiled their bodies, and then scraped themselves clean with a strigil. They also competed nude. What girls wore varied by place. Sparta was unusual in letting girls exercise naked at the gymnasium alongside boys and men.
The gymnasium was never only a sports ground. Greek gymnasia also held lectures and discussions on philosophy, literature and music, and philosophers gathered there. Athens had three famous ones. Plato's school met at the Academy and took its name from it. Aristotle founded his school at the Lyceum. Antisthenes taught at the Cynosarges, which some link to the name "Cynic." Even in Greek, gymnasion could also mean "school."
Latin kept both senses: gymnasium meant an exercise ground or a school. English took the athletic sense, and Merriam-Webster dates it to 1598. Today an American gymnasium is an indoor room or building for sports such as basketball or boxing.
In parts of Europe the academic sense won instead. Merriam-Webster defines a European gymnasium as a secondary school that prepares students for university. The German term comes from the Latin meaning "school." So a German student heading to the Gymnasium is going to class, not to the weight room, and keeps their clothes on either way.
The naked root has one more well-known descendant. A gymnosperm, such as a conifer or a ginkgo, is a plant whose seeds are not enclosed in an ovary. Its name joins gymnos with sperma, "seed."