a Middle English merger of Old English in (prep.) "in, into, upon, on, at, among; about, during;" and Old English inne (adv.) "within, inside," from Proto-Germanic *in (source also of Old Frisian, Dutch, German, Gothic in, Old Norse i), from PIE root *en "in." The simpler form took on both senses in Middle English.
Sense distinction between in and on is from later Middle English, and nuances in use of in and at still distinguish British and American English (in school/at school). Sometimes in Middle English shortened to i.
The noun sense of "influence, access (to power or authorities)," as in have an in with, is first recorded 1929 in American English. to be in for it "certain to meet with something unpleasant" is from 1690s. To be in with "on friendly terms with" is from 1670s. Ins and outs "intricacies, complications of an action or course" is from 1660s. In-and-out (n.) "copulation" is attested from 1610s.
Old English betweonum, Mercian betwinum, "in the space which separates, midway, in the midst, among; by turns," from bi- "by" (see by) + tweonum dative plural of *tweon "two each" (compare Gothic tweih-nai "two each;" from PIE root *dwo- "two").
Between is literally applicable only to two objects; but it may be and commonly is used of more than two where they are spoken of distributively, or so that they can be thought of as divided into two parts or categories, or with reference to the action or being of each individually as compared with that of any other or all the others. When more than two objects are spoken of collectively or in divisibly, among is the proper word. [Century Dictionary]
In all senses, between has been from its earliest appearance, extended to more than two. [OED]
Between a rock and a hard place "caught in a dilemma, in a difficult situation" is from 1940s, originally cowboy slang (earlier was between the beetle (hammer) and the block, late 19c.). Between-whiles "at intervals" is from 1670s.
Others are reading
Definitions of in-between
being neither at the beginning nor at the end in a series;