Function
mid 16th century: from French fonction, from Latin functio(n- ), from fungi ‘perform’.
wiktionary
From Middle French function, from Old French fonction, from Latin functiō(“performance, execution”), from functus, perfect participle of fungor(“to perform, execute, discharge”).
etymonline
function (n.)
1530s, "one's proper work or purpose; power of acting in a specific proper way," from French fonction (16c.) and directly from Latin functionem (nominative functio) "a performance, an execution," noun of action from funct-, past-participle stem of fungi "perform, execute, discharge," from PIE *bhung- "be of use, be used" (source also of Sanskrit bhunjate "to benefit, make benefit, atone," Armenian bowcanem "to feed," Old Irish bongaid "to break, harvest"), which is perhaps related to root *bhrug- "to enjoy." Meaning "official ceremony" is from 1630s, originally in church use. Use in mathematics probably was begun by Leibnitz (1692). In reference to computer operations, 1947.
function (v.)
1844, "perform a function" (intransitive), from function (n.). Related: Functioned; functioning.