Old English acan "suffer continued pain," from Proto-Germanic *akanan, perhaps from a PIE root *ag-es- "fault, guilt," represented also in Sanskrit and Greek, which is perhaps imitative of groaning.
Originally the verb was pronounced "ake," the noun "ache" (as in speak/speech). The noun changed pronunciation to conform to the verb, but the spelling of both was changed to ache c. 1700 on a false assumption of a Greek origin (specifically Greek akhos "pain, distress," which rather is a distant relation of awe (n.)). Related: Ached; aching.