Nietzsche, along with other historians and thinkers, attributed the first articulation of the dichotomy of good vs evil to the Persian prophet Zarathustra. In his own autobiography Ecce Homo, Nietzsche points out how this is the basis for his choice of Zarathustra as a mouthpiece for the philosophical teachings presented in this book:
“Zarathustra was the first to see in the struggle of good and evil the true driving-wheel in the machinery of things—the translation of morality into the metaphysical, as strength, cause, goal in itself, is his doing […] Zarathustra created the disastrous error that is morality: thus he must also be the first to acknowledge the mistake.”
Ecce Homo, Why I Am a Destiny, section 3.