Mat 15:22 and a Canaanite woman from that region came out and began to cry out, saying, "Have mercy on me, Lord, Son of David; my daughter is cruelly demon-possessed."
This woman that is beseeching the Lord to save her daughter refers to Jesus as Son of David. That indicates that she knows or at least acknowledges that Jesus is the Son of God.
Mat 15:23 But He did not answer her word. And His disciples came and implored Him, saying, "Send her away, because she keeps shouting at us." Mat 15:24 But He answered and said, "I was sent only to the lost sheep of the house of Israel."
Jesus is indicating that he came to the earth to witness to the Jews in order to have them spread the gospel to all people. She continues to implore him to help her daughter until the disciples wanted her gone.
Mat 15:25 But she came and began to bow down before Him, saying, "Lord, help me!" Mat 15:26 And He answered and said, "It is not good to take the children's bread and throw it to the dogs." Mat 15:27 but she said, "Yes, Lord; but even the dogs feed on the crumbs which fall from their masters' table."
Here Jesus is referring to the message he brings to the Jews as bread. But the woman counters with “but even dogs feed on the crumbs which fall from their masters’ table”. Why was Jesus balking at this task of removing the demon? Remember the two men he met when they crossed the Sea and cast the demons into the pigs. Matthew 8: 28-32. No one even asked there.
Mat 15:28 Then Jesus said to her, "O woman, your faith is great; it shall be done for you as you wish." And her daughter was healed at once.
This act of Jesus first refusing and then granting here wish was another teaching moment in the lives of the disciples and for the gentile woman. Faith is what you need, faith in the Christ who was sent to earth to save us from our own sins. The woman had it, now the disciples saw what it would do.