Old English be- (unstressed) or bi (stressed) "near, in, by, during, about," from Proto-Germanic *bi "around, about," in compounds often merely intensive (source also of Old Saxon and Old Frisian bi "by, near," Middle Dutch bie, Dutch bij, German bei "by, at, near," Gothic bi "about"), from PIE *bhi, reduced form of root *ambhi- "around."
As an adverb by c. 1300, "near, close at hand." OED (2nd ed. print) has 38 distinct definitions of it as a preposition. Originally an adverbial particle of place, which sense survives in place names (Whitby, Grimsby, etc., also compare rudesby). Elliptical use for "secondary course" was in Old English (opposed to main, as in byway, also compare by-blow "illegitimate child," 1590s, Middle English loteby "a concubine," from obsolete lote "to lurk, lie hidden"). This also is the sense of the second by in the phrase by the by (1610s). By the way literally means "along the way" (c. 1200), hence "in passing by," used figuratively to introduce a tangential observation ("incidentally") by 1540s.
To swear by something or someone is in Old English, perhaps originally "in the presence of." Phrase by and by (early 14c.) originally meant "one by one," with by apparently denoting succession; modern sense of "before long" is from 1520s. By and large "in all its length and breadth" (1660s) originally was nautical, "sailing to the wind and off it," hence "in one direction then another;" from nautical expression large wind, one that crosses the ship's line in a favorable direction.
elementary intransitive verb of motion, Old English cuman "to move with the purpose of reaching, or so as to reach, some point; to arrive by movement or progression;" also "move into view, appear, become perceptible; come to oneself, recover; arrive; assemble" (class IV strong verb; past tense cuom, com, past participle cumen), from Proto-Germanic *kwem- (source also of Old Saxon cuman, Old Frisian kuma, Middle Dutch comen, Dutch komen, Old High German queman, German kommen, Old Norse koma, Gothic qiman), from PIE root *gwa- "to go, come."
The substitution of Middle English -o- for Old English -u- was a scribal habit before minims to avoid misreading the letters in the old style handwriting, which jammed them together (see U). Modern past tense form came is Middle English, probably from Old Norse kvam, replacing Old English cuom.
Meaning "to happen, occur" is from early 12c. (come to pass "happen, occur" is from 1520s). As an invitation to action, c. 1300; as a call or appeal to a person (often in expanded forms: "come, come," "come, now"), mid-14c. Come again? as an off-hand way of asking "what did you say?" is attested by 1884. For sexual senses, see cum.
Remarkably productive with prepositions (NTC's "Dictionary of Phrasal Verbs" lists 198 combinations); consider the varied senses in come to "regain consciousness," come over "possess" (as an emotion), come at "attack," come on (interj.) "be serious," and come off "occur, have some level of success" (1864). Among other common expressions are:
To come down with "become ill with" (a disease), 1895; come in, of a radio operator, "begin speaking," 1958; come on "advance in growth or development," c. 1600; come out, of a young woman, "make a formal entry into society," 1782; come round "return to a normal state or better condition," 1841; come through "act as desired or expected," 1914; come up "arise as a subject of attention," 1844; come up with "produce, present," 1934.
To have it coming "deserve what one suffers" is from 1904. To come right down to it "get to fundamental facts" is from 1875.