"plainclothes detective," 1906, from the rubber-soled shoes they wore (allowing stealthy movement), which were so called from 1863 (gums "rubber shoes" is attested by 1859); from gum (n.1) + shoe (n.).
Entries linking to gumshoe
gum n.1
c. 1300, "resin from dried sap of plants," from Old French gome "(medicinal) gum, resin," from Late Latin gumma, from Latin gummi, from Greek kommi "gum," from Egyptian kemai. As the name of a hardened, sweetened gelatine mixture as a candy, 1827. As a shortened form of chewing gum, first attested 1842 in American English. The gum tree (1670s) was so called for the resin it exudes. Latin gummi also is the source of German Gummi (13c.).
shoe n.
Middle English sho, "low-cut covering for the human foot," from Old English scoh, from Proto-Germanic *skokhaz (source also of Old Norse skor, Danish and Swedish sko, Old Frisian skoch, Old Saxon skoh, Middle Dutch scoe, Dutch schoen, Old High German scuoh, German Schuh, Gothic skoh). No known cognates outside Germanic, unless it somehow is connected with PIE root *skeu- "cover" (source also of second element in Latin ob-scurus).
The old plural form shoon lasted until 16c. The meaning "metal plate or rim nailed to the hoof of a horse or beast of burden to protect it from injury" is attested from c.1300. The distinction between shoe and boot (n.) is attested from c. 1400.
To stand in someone's shoes "see things from his or her point of view" is attested from 1767. Old shoe as a type of something worthless is attested from late 14c.
Shoes tied to the fender of a newlywed couple's car preserves the old custom (mentioned from 1540s) of throwing an old shoe at or after someone to wish them luck. Perhaps the association is with dirtiness, on the "muck is luck" principle.