ape (n.) Look up ape at Dictionary.com
Old English apa "ape, monkey," from Proto-Germanic *apan (cognates: Old Saxon apo, Old Norse api, Dutch aap, German affe), perhaps borrowed in Proto-Germanic from Celtic (compare Old Irish apa) or Slavic (compare Old Bohemian op, Slovak opitza), perhaps ultimately from a non-Indo-European language.

Apes were noted in medieval times for mimicry of human action, hence, perhaps, the other figurative use of the word, to mean "a fool." To go ape (in emphatic form, go apeshit) "go crazy" is 1955, U.S. slang. To lead apes in hell (1570s) was the fancied fate of one who died an old maid.
ape (v.) Look up ape at Dictionary.com
"to imitate," 1630s, but the notion is implied earlier, as in the phrase play the ape (1570s), Middle English apeshipe "ape-like behavior, simulation" (mid-15c.); and the noun sense of "one who mimics" may date from early 13c. Related: Aped; aping.