Old English fæst "firmly fixed, steadfast, secure, enclosed," probably from Proto-Germanic *fastuz (cf. Old Frisian fest, Old Norse fastr, Dutch vast, German fest), from PIE root *past- "firm" (cf. Sanskrit pastyam "dwelling place").
The adverb meaning "quickly, swiftly" was perhaps in Old English, or from Old Norse fast, either way developing from the sense of "firmly, strongly, vigorously" (cf. to run hard means to run fast; also compare fast asleep), or perhaps from the notion of a runner who "sticks" close to whatever he is chasing.
The sense of "living an unrestrained life" (usually of women) is from 1746 (