By the time of the establishment of Israel, divorce was already cultural reality. The first mention of divorce in scripture is in telling the priests of Israel that they may not marry a woman who has been divorced (Lev 21:7).
To say that the Bible is inerrant is to say that there are no errors or mistakes in the Bible. The doctrine of inerrancy is inseparable from the doctrine of inspiration. It’s quite simple actually. If God told Moses to write something down and God is the author, then there can be no mistake because God is perfect.