More importantly this is a DIR section of the forum, so unless you are asking serious questions you should not be in here.
Jesus knew already what the woman wanted, what she would ask, and the outcome of the situation before it even happened. It was said the way it was, so that it would be recorded for us to read in later times.
It simply pointed out that gentiles, according to Jews were heathens, dogs, etc... So he went with that idea, knowing full well he planned to help the lady, he said it in a way to mock the Jews. To which she played along, by saying but even dogs eat the crumbs, etc...
She knew he was Christ, and He knew that she knew. So their dialog was in gest, and she was not offended at all.
Kind of like this. Let's say there was a boy who made a group of kids mad because he was different. He dressed different, acted different, etc... The group spread rumors about the boy, that he had cooties, and smelled funny.
Then comes along a girl, despite what she had heard and asked the boy to play. The boy realizing she saw through the ramblings of the group, and knew the boy to not be as rumored.
So the boy replies to her, you know if you play with me, you will get cooties and start to smell funny. She playing along says, oh it's OK, I like to smell funny.