It is not known where this is written. It does not seem to be in our present Old Testament, nor does it appear to be consistent with the spirit of what we would expect in the brass plates. The Old Testament states:
“Thou shalt not hate thy brother in thine heart: thou shalt in any wise rebuke thy neighbour, and not suffer sin upon him. Thou shalt not avenge, nor bear any grudge against the children of thy people, but thou shalt love thy neighbour as thyself: I am the Lord.”
(Leviticus 19:17-18.)
In Galilee, Jesus may have been responding to beliefs that were held by the Essenes, an ultra-orthodox group of Jews who sought to escape the contamination of the world and build a life upon principles of piety and ritual cleanliness.
The Dead Sea Community, believed by most scholars to have been Essenes, were essentially taught to love the “sons of light” (believers, members of the community) and hate the “sons of darkness” (outsiders). The, were to “love all that [God] has chosen and hate all that He has rejected.”
The member of the community was to “bear unremitting hatred towards all men of ill repute, and to be minded to keep in seclusion from them.” (The Manual of Discipline 1:9-11; 9:21-23, in Theodor H. Gaster, trans., The Dead Sea Scriptures, pp. 44, 65.) Whether such apostate beliefs were held among the Nephites, or again, whether the Lord was simply providing these teachings so that the Nephites could understand what was taught in Galilee, is unknown.