Jesus was a carpenter by trade:
Mark 6:3 King James Version (KJV)
3 Is not this the carpenter, the son of Mary, the brother of James, and Joses, and of Juda, and Simon? and are not his sisters here with us? And they were offended at him.
Jesus taught in a synagogue on the sabbath, he was not working as a carpenter on the sabbath:
Mark 1:21 King James Version (KJV)
21 And they went into Capernaum; and straightway on the sabbath day he entered into the synagogue, and taught.