Some forms of contemporary Judaism do not include a belief in life after death. We know that in Jesus' day there was a great debate over that point between two parties of the contemporary Jewish nation, the Pharisees and the Sadducees. The Pharisees believed in life after death; the Sadducees did not. You would think that those who were leaders in the household of Israel would be agreed on a point like that if it were spelled out with obvious clarity in the Old Testament.
Of course, one of the debates between those two parties was what constituted the Old Testament. Was it just the first five books of Moses, or did it include all of what today's Christian would consider to be the Old Testament—the Prophets and the Wisdom Literature? The concept of life after death in the Old Testament (indicated often by references to Sheol) is somewhat vague and shadowy; death is depicted as a place beyond the grave where both good and bad people go. The clarity with which the New Testament proclaims life after death is not found in the same dimension in the Old Testament. I think it's there, and if you study the Major Prophets, particularly Isaiah, you will see that the teaching of life after death is clearly set forth in the Old Testament. However, I'm looking at the Old Testament with the benefit of the information coming to me through the New Testament.
Certainly there were lots of folks who read the same Old Testament material and didn't see references to afterlife so clearly. During Job's struggle with earthly trials, he asked, "If a man dies, will he live again?" We see later that Job says in a note of triumph and as an expression of confidence and faith, "I know that my Redeemer liveth, and I will see him standing on that day." Christians have looked back at that and said, "Well, if Job is that confident of a redeemer who will set him free in some distant future, then obviously this is an expression from great antiquity of confidence in life after death." But Job's word that is translated "redeemer" actually means "vindicator." Job is simply saying that he is confident he will be vindicated. Now, whether or not that included in Job's mind an ultimate vindication in heaven is again subject to some debate.
David's confidence, however, of future reunion with his child who had died is a clear indication of his confidence in an afterlife. It was not unknown among the Old Testament saints that there would be a future life. It simply is not as clear as it is in the New Testament.