It's apparent that the family into which Jesus was born was a very Torah-observant Jewish family. They were scrupulous in adhering to the commands God gave regarding childbirth.
Because of the way in which we have anglicized the names of people in the New Testament, we tend to subconsciously think of them as Gentiles. The one we call Mary is actually Miriam, a common Jewish name, named after the sister of Moses. Jesus was actually Yeshua, a common shortened form of the name Yehoshua (Joshua), which means "the LORD saves". It is a near-synonym for the Hebrew word for salvation, yeshuah, which the angel alluded to in Matthew 1:21 when Joseph was told to "call his name Yeshua, for he will save his people from their sins".
In Luke's account, Mary went to stay with relatives, Zechariah and Elizabeth, shortly after becoming pregnant. Both of these relatives are described as descendants of Aaron (1:5), Zechariah being a priest. In addition it is mentioned (1:6) that "both of them were upright in the sight of God, observing all the Lord's commandments and regulations blamelessly." This must have been important to Luke, to note and commend this faithfulness so prominently.
After Jesus was born, the Law mandated that he be circumcised on the eighth day. This command is first given to Abraham in Genesis 17 and is described as an everlasting covenant (17:7-14). Consequently it was followed by the parents of Jesus (Luke 2:21), as well as by virtually all Jewish parents to this day.
Another command that was followed by Jesus parents involved the purification of the mother after childbirth. Leviticus 12 describes the process. When a woman gives birth to a son, she is considered unclean for seven days. Then she must wait 33 days to be purified before going to the temple. Then she must go and make an offering of two animals, one for a burnt offering and one for a sin offering. Mary did this as recorded in Luke 2:22.
Another reason she went to the temple after that was to take part in the ceremony called pidyon ha ben, or the dedication of the first-born son. In Exodus 13:1-16 the command is given to consecrate every first-born male to the LORD. This is in connection with the Passover events when the LORD killed every first-born among the Egyptians but spared those among the obedient Hebrews who had blood on the door. Luke 2:22-23 records that it was for both of these reasons that Mary and Joseph took Jesus to the temple.
During their visit to the temple they met two individuals who blessed God in regard to the baby. (The Jewish way was to bless God, not the person, the food, or anything else.) Neither of them were temple employees. Simeon was a devout man who was led by the Spirit to go to the temple that day. Anna was an aged widow who stayed at the temple, worshiping and praying. Both of these Torah-observing people are spoken of favorably in the text.
As the passage continues, we are told that Mary and Joseph went to Jerusalem every year for the Feast of Passover (2:41). This was commanded of all Jewish men (Deu. 16:16-17). Three times a year, at Passover, Pentecost, and Tabernacles, each man was to go to Jerusalem to make an offering to the LORD. Not everyone did this, but the household of Joseph and Mary were careful in their observance of the commandments. It's worth noting that Jesus continued this custom in his adult life (as did Paul).
It is interesting to note that five times in chapter two of Luke (2:22, 23, 24,27, 39) it is specified that they were doing these things to comply with the Law. Once it is called the Law of Moses, three times the Law of the Lord, and once just the Law. It is clear that the author wanted to emphasize that this family lived their life carefully in accordance with Torah.
Jesus on the Sabbath