"abstain from food," Old English fæstan "to fast" (as a religious duty), also "to make firm; establish, confirm, pledge," from Proto-Germanic *fastanan "to hold, guard," extended to the religious act "observe abstinence" (source also of Old Frisian festia, Old High German fasten, German fasten, Old Norse fasta "abstain from food"), from the same root as fast (adj.).
The original meaning in prehistoric Germanic was "hold firmly," and the sense evolved via "have firm control of oneself," to "hold oneself to observance" (compare Gothic fastan "to keep, observe," also "to fast"). Perhaps the Germanic sense shifted through use of the native words to translate Medieval Latin observare in its sense "to fast," or it might have been a loan-translation of a Greek expression brought to the Goths by Arian missionaries and spread from them to other Germanic peoples. The verb in the sense "to make fast" continued in Middle English, but was superseded by fasten. Related: Fasted; fasting.