Joseph rose to the highest rank in Pharoah’s palace and became Egypt’s number one citizen. Yet in spite of that he remained true to the God of Abraham, Isaac and Jacob. Here are some paraphrased words from one of my teachers, Rabbi Ze’ev Leff about how Joseph and his brothers did it.
Joseph coached his brothers prior to their first meeting with Pharaoh. He told them to emphasize that they were shepherds from time immemorial so that they would be sent to live apart in Goshen, because shepherds were an abomination to the Egyptians.
Instead of asking them to hide that they were shepherds so that they would be more readily accepted, Joseph emphasized that fact. He realized that their ability to survive the Egyptian exile depended on their capacity to remain apart, and Goshen was well-suited to that purpose.
Before actually descending to Egypt, Jacob sent Judah ahead to prepare the way. The Sages say that his function was to establish a Yeshiva (Torah Study Hall) in Goshen. Seemingly this task should have been given to Levi, the teacher of the Jewish people, not to Judah, the king. But this Yeshiva was not merely a place of Torah study, it was the means of transferring the holiness of Israel to Egyptian soil.
Goshen was to become a spiritually sovereign region within the environs of Egypt. Areas adjacent to Israel conquered in war take on some of the spiritual status of Israel. Thus the king, Judah, was needed to conquer Goshen as a spiritual extension of the Land of Israel.
The Sages tell us that the study halls and Shuls (Synagogues) in exile are parts of Israel transplanted to foreign soil. It is in them and around them that we must build a temporary physical dwelling place that is spiritually rooted in the holiness and purity of Israel. As long as one is physically prevented from being in Israel, he must transplant Israel to foreign soil. In this way the Jew insulates himself from assimilating into the host society and culture.