We are not told explicitly but he may have been invited to teach on account of his fame.1 The town of Nazareth was a small village; everyone would have been aware of his fame and perhaps eager to listen to him. As a Jewish man, he would also have the right to read and interpret a passage of Scripture. It was not only the teachers of the law who were allowed to do this.
2 And on the Sabbath he began to teach in the synagogue, and many who heard him were astonished, saying, “Where did this man get these things? What is the wisdom given to him? How are such mighty works done by his hands?