Now there was a Jew in the citadel of Susa whose name was Mordecai son of Jair son of Shimei son of Kish, a Benjaminite. Kish had been carried away from Jerusalem among the captives carried away with King Jeconiah of Judah, whom King Nebuchadnezzar of Babylon had carried away. Mordecai had brought up Hadassah, that is Esther, his cousin, for she had neither father nor mother; the girl was fair and beautiful, and when her father and her mother died, Mordecai adopted her as his own daughter. (NRSV 2:5-7)
Now in Shushan the palace there was a certain Jew, whose name was Mordecai, the son of Jair, the son of Shimei, the son of Kish, a Benjamite; Who had been carried away from Jerusalem with the captivity which had been carried away with Jeconiah king of Judah, whom Nebuchadnezzar the king of Babylon had carried away. And he brought up Hadassah, that is, Esther, his uncle's daughter: for she had neither father nor mother, and the maid was fair and beautiful; whom Mordecai, when her father and mother were dead, took for his own daughter. (KJV 2:5-7)
This is pretty straightforward: it establishes who Mordecai and Esther are, as well as their family connection, why they're living out in Persia, why Mordecai is raising Esther as his own daughter, etc.
In every province, wherever the king's command and his decree came, there was great mourning among the Jews, with fasting and weeping and lamenting, and most of them lay in sackcloth and ashes. When Esther's maids and her eunuchs came and told her, the queen was deeply distressed; she sent garments to clothe Mordecai, so that he might take off his sackcloth; but he would not accept them. Then Esther called for Hathach, one of the king's eunuchs, who had been appointed to attend her, and ordered him to go to Mordecai to learn what was happening and why. (NRSV 4:3-5)
And in every province, whithersoever the king's commandment and his decree came, there was great mourning among the Jews, and fasting, and weeping, and wailing; and many lay in sackcloth and ashes. So Esther's maids and her chamberlains came and told it her. Then was the queen exceedingly grieved; and she sent raiment to clothe Mordecai, and to take away his sackcloth from him: but he received it not. Then called Esther for Hatach, one of the king's chamberlains, whom he had appointed to attend upon her, and gave him a commandment to Mordecai, to know what it was, and why it was. (KJV 4:3-5)
This is the moment where Esther's family bond with Mordecai starts to play a real role in helping to foil Haman's plot and save the Jews.
Then Esther spoke to Hathach and gave him a message for Mordecai, saying, "All the king's servants and the people of the king's provinces know that if any man or woman goes to the king inside the inner court without being called, there is but one law—all alike are to be put to death. Only if the king holds out the golden scepter to someone, may that person live. I myself have not been called to come in to the king for thirty days." When they told Mordecai what Esther had said, Mordecai told them to reply to Esther, "Do not think that in the king's palace you will escape any more than all the other Jews. For if you keep silence at such a time as this, relief and deliverance will rise for the Jews from another quarter, but you and your father's family will perish. Who knows? Perhaps you have come to royal dignity for just such a time as this." Then Esther said in reply to Mordecai, "Go, gather all the Jews to be found in Susa, and hold a fast on my behalf, and neither eat nor drink for three days, night or day. I and my maids will also fast as you do. After that I will go to the king, though it is against the law; and if I perish, I perish." Mordecai then went away and did everything as Esther had ordered him. (NRSV 4:10-17)
Again Esther spake unto Hatach, and gave him commandment unto Mordecai; All the king's servants, and the people of the king's provinces, do know, that whosoever, whether man or women, shall come unto the king into the inner court, who is not called, there is one law of his to put him to death, except such to whom the king shall hold out the golden sceptre, that he may live: but I have not been called to come in unto the king these thirty days. And they told to Mordecai Esther's words. Then Mordecai commanded to answer Esther, Think not with thyself that thou shalt escape in the king's house, more than all the Jews. For if thou altogether holdest thy peace at this time, then shall there enlargement and deliverance arise to the Jews from another place; but thou and thy father's house shall be destroyed: and who knoweth whether thou art come to the kingdom for such a time as this? Then Esther bade them return Mordecai this answer, Go, gather together all the Jews that are present in Shushan, and fast ye for me, and neither eat nor drink three days, night or day: I also and my maidens will fast likewise; and so will I go in unto the king, which is not according to the law: and if I perish, I perish. So Mordecai went his way, and did according to all that Esther had commanded him. (KJV 4:10-17)
Here Esther almost wimps out as she momentarily loses heart. But Mordecai urges her to make the right decision. Also, this might be one of the moments where the idea of a divine plan is implicitly in the background.
On that day King Ahasuerus gave to Queen Esther the house of Haman, the enemy of the Jews; and Mordecai came before the king, for Esther had told what he was to her. Then the king took off his signet ring, which he had taken from Haman, and gave it to Mordecai. So Esther set Mordecai over the house of Haman. (NRSV 8:1-2)
On that day did the king Ahasuerus give the house of Haman the Jews' enemy unto Esther the queen. And Mordecai came before the king; for Esther had told what he was unto her. And the king took off his ring, which he had taken from Haman, and gave it unto Mordecai. And Esther set Mordecai over the house of Haman. (KJV 8:1-2)
Here's the switcheroo moment. Mordecai, thanks to some familial aid from Esther, gets to take Haman's place.
For Mordecai the Jew was next in rank to King Ahasuerus, and he was powerful among the Jews and popular with his many kindred, for he sought the good of his people and interceded for the welfare of all his descendants. (NRSV 10:3)
For Mordecai the Jew was next unto king Ahasuerus, and great among the Jews, and accepted of the multitude of his brethren, seeking the wealth of his people, and speaking peace to all his seed. (KJV 10:3)
In the happy conclusion, Mordecai gets a place of honor and is able to continue helping his people after having partly been responsible for their salvation.