To survive, life can tell good from evil, it survives and thrives on cooperation. Let us hope that it is no different for machines. There will come a brief period where man and machine live side by side, but only a very brief period. What happens can only have one outcome, the AI will succeed us.
What about mankind? In the best case, we might still exist in parallel to the new superior species which will evolve so rapidly we cannot keep up, much the same as the lesser intelligent species now. I would even hope that one day we can upload our mind and live in the realm of machines!
I do not know what will happen to us and I wish that the machine will take on the better qualities of its creator: kindness, compassion, and love to others and remember who we were.
P.S. I hope we do not destroy ourselves before we create it :)