late 14c., "set (one's eyes or mind) on something" (a figurative use), probably from Old French verb *fixer, from fixe "fixed," from Latin fixus "fixed, fast, immovable; established, settled," past-participle adjective from figere "to fix, fasten, drive, thrust in; pierce through, transfix," also figurative, from PIE root *dheigw- "to pierce, stick in;" hence "to fix, fasten."
Sense of "fasten, attach" is c. 1400; that of "to make (colors, etc.) fast or permanent" is from 1660s. The meaning "settle, assign" evolved into "adjust, arrange" (1660s), then "to repair" (1737), but this sometimes was objected to (see below). Sense of "tamper with" (a fight, a jury, etc.) is from 1790. As euphemism for "castrate a pet" it dates from 1930. Related: Fixed; fixing.
To fix is to make fast, or permanent; to set immoveably, &c.: hence, to fix a watch, is to stop it, or prevent it from 'going;' which, it must be admitted, is a very unsatisfactory mode of repairing that article. [Seth T. Hurd, "A Grammatical Corrector; or, Vocabulary of the Common Errors of Speech," 1847]