Looking at the Old Testament with our knowledge of the New, we can see that the Trinity was foreshadowed, but it was not taught in terms of one God in three Persons. The doctrine of the Trinity was revealed by Christ to his disciples; it is a doctrine that would have remained unknown to us unless God had revealed it.
The Old Testament suggests that the Holy Spirit is God. There are passages that show the Spirit is a Person--for example, when the Spirit speaks (2 Sm 23:2, Ez 2:2, 3:24, 11:5). There are also passages showing the Spirit has divine attributes, such as omnipresence (Ps 139:7). A Person with divine attributes is a divine Person and, hence, a member of the Trinity.
One of the most commonly cited intimations of the doctrine of the Trinity is that God speaks to himself using a plural in Genesis. In Genesis 1:26-27 God says, "Let us make man in our image," and then we read "in the image of God he created him."
The triple-cry of the seraphim in Isaiah, "Holy, holy, holy is the Lord of hosts; the whole earth is full of his glory" (Is 6:3), is thought to reflect the Trinity.
Some have also seen the appearance of three men to Abraham in Genesis 18 as a manifestation of the Trinity, though this is unclear. Genesis 19:1 seems to refer to two of the three men from chapter 18 as angels.