my take on it is since shiva was part of teachers soul, when they were put together in the same vessel (that being teacher), they were able to comunicate even tho they are not on the same plane of existence, much like you would communicate with your heart or have an internal dialog, his soul name is shiva, and thats what shes become, they will always be together. In the end when they're talking about the curse they mention how blurry the difference between light and dark, life and death is and that might be the true curse, the teacher has both the body of the mother (black child shiva's head) and the soul of the father ( his own soul that is also shiva) so he is the only one cursed, the other black children are born from mother and It seems like the people from inside wont be cursed anymore.
I also think that the manifestation of shiva as a young child was because teacher had lost his wife and child when he became an outsider, and that makes the previous point stronger because when you have a child, part of you becomes that new life and you will always carry your child in your heart, much like teachers soul became shiva and he will always have shiva in his heart now, thats his daughter.
But since most panels at the end are always focusing on teacher, who's very tall, or on shivas POV we cant see for sure if they were able to sucessfully share a soul and mantain shiva physical form or if shes truly physically gone, but I think the author intended this to be an open ending.

Can someone explain to me the end? I am trying to understand it