Did the Jewish people choose G-d, or did G-d choose the Jewish people? Or both?
Both, according to the commentary of Rashi to Deuteronomy 26:17–18.
According to a Midrash (and Maimonides' understanding of it), the patriarch Abraham discovered G-d.
In Laws of Idolatry 1.1-2 Maimonides explains how humans began to worship idols and how Abraham was the first to rediscover G-d. He felt that Abraham was a natural philosopher who came to the realization of G-d’s existence. He recognized that G-d exists, is one, and created all things. He discovered this, as Prof. Menachem Keller writes, “on the basis of his unaided reason.” Keller adds a footnote “Abraham, that is, came to knowledge of G-d through philosophic conviction, not religious faith.”
Thus, Kellner wrote that "Abraham discovered G-d on his own." This was accomplished by Abraham applying Aristotelian physics, a thorough understanding of the laws of nature, philosophy, and reason. In short, Abraham came to G-d, and not the other way around.
 See TheTorah.com essay called How did Abraham Discover God The Rationalistic Approach
 See chapter 2 Chosenness, Not Chauvinism: Maimonides on the Chosen People by Menachem Kellner
 A Midrash and tradition says that Abraham discovered G-d through reason and studying the heavens, natural law