word-forming element meaning "not, opposite of, without" (also im-, il-, ir- by assimilation of -n- with following consonant, a tendency which began in later Latin), from Latin in- "not," cognate with Greek an-, Old English un-, all from PIE root *ne- "not."
In Old French and Middle English often en-, but most of these forms have not survived in Modern English, and the few that do (enemy, for instance) no longer are felt as negative. The rule of thumb in English has been to use in- with obviously Latin elements, un- with native or nativized ones.
c. 1400, "active or secular life," from Old French activité, from Medieval Latin activitatem (nominative activitas), a word in Scholastic philosophy, from Latin activus "active" (see active). Meaning "state of being active, briskness, liveliness" recorded from 1520s; that of "capacity for acting on matter" is from 1540s. As "an educational exercise," 1923.
<a href="https://www.etymonline.com/word/inactivity">Etymology of inactivity by etymonline</a>
Harper, D. (n.d.). Etymology of inactivity. Online Etymology Dictionary. Retrieved $(datetime), from https://www.etymonline.com/word/inactivity