It is believed that the idea of proof was originated from the Greeks. We don't have any proofs written by Babylonians or Egyptians. Of course it does not mean that they don't have any proofs. Maybe they have some proofs but they were much rarer than textbooks that have algorithms for solving mathematical problems. Or maybe they taught some forms of proofs only orally. It's much harder to write down the proof than explain it orally. Old Babylonians knew some sophisticated facts, like Pythagorean theorem. So they had to have some justifications for them, but we simply don't know how they justify it.
The earlier proofs that we know are in Euclid's Elements. However it is certain that the idea of proofs were known earlier. For example Thales (who is the first known Greek mathematician) was said to proof that diameter divide the circle by two equal parts. The fact that Thales had to prove such obvious statement means that the notion of formal proof was known even at that time. However some historian do not believe this fact.