1530s, "proper work or purpose," from Middle French fonction (16c.) and directly from Latin functionem (nominative functio) "performance, execution," noun of action from functus, past participle of fungi "perform, execute, discharge," from PIE root *bheug- (2) "to use, enjoy" (see brook (v.)). Use in mathematics probably begun by Leibnitz (1692).