Often when I hear religious people talk about this or that person in the Bible doing something that God asked, the phrase "Because God said so" is emphasized. It is also talked about how there can be no morality without God, and questions like "If killing you made my life better, why shouldn't I do it?" are asked. But what if God was to tell you to do something like rape your child, or to torture people for eternity? Do you do it? And I'm not being a troll, I'm asking ernestly.
There is a misunderstanding of the nature of God. A major attribute of God is that He does no sin, nor does He encourage others to sin.
"Let no one say when he is tempted, "I am being tempted by God"; for God cannot be tempted by evil, and He Himself does not tempt anyone" (James 1:13).
"This is the message we have heard from Him and announce to you, that God is Light, and in Him there is no darkness at all" (I John 1:5).
It is more than the fact that God does not sin -- God cannot sin because doing so is against His very nature. See: Holy is His Name for more information on this topic.
Therefore, the basis of your questions cannot occur. You are asking what if the impossible happens.