How do we know that Psalm 22 is a prophecy about Jesus' crucifixion? I appreciate the fact that the David describes elements of crucifixion even though crucifixion had not yet been invented, if you will. Perhaps it was some type of hyperbole or symbolic description of what he was feeling at the time. Besides, why would David have been thinking about Christ's crucifixion?
Jesus himself said in Luke, "This is what I told you while I was still with you: Everything must be fulfilled that is written about me in the Law of Moses, the Prophets and the Psalms." ( Luke 24:44) proving that Psalms was a prophetic book about Christ. David (Just as all the prophets) wrote under divine inspiration by the Holy Spirit and Psalm 22 is perhaps the most compelling chapter about Jesus in the entire book. Perhaps David didn't understand completely what he was writing at the time, which is why it is prophetic, but as we read this today there is no doubt that this was a prophesy about Jesus. Just look at all of the references in this chapter alone, then go to Matthew 26 & 27 and you will see that it happened exactly has David wrote in Psalm 22.
Psalm 22 - My God, My God why have you forsaken me? (Jesus said this on the cross)
Psalm 22:6-8 - They ridiculed Him, "let him come down off the cross" etc.
Psalm 22:9 - bulls surround me - (represent the Jewish leaders at the time)
Psalm 22:14 - I am poured out (His side was pierced and blood and water flowed out)
Psalm 22:13 - his heart would melt like wax within him - water coming out of side
Psalm 22:15 - I thirst (They gave Him wine vinegar to drink)
Psalm 22:16 - Dogs Surround me (this was reference to the Romans soldiers)
Psalm 22:16 - they pierced my hands and feet (written long before the practice of crucifixion was even invented or practiced)
Psalm 22:18 - divided garments and cast lots (1 piece of clothing they didn't want to tear it so they cast lots)
This chapter has so many Messianic Prophecies about Jesus and what is amazing is that it wasn't only Jesus who fulfilled them. Many were fulfilled by others during this time (Jewish leaders, Roman soldiers etc). This is very important to know because it solidifies the fact that Jesus is the Messiah, Look at one of the first thing He did after He rose again, On the road to Emmaus he opened up the disciples understanding by going back to Moses and the Prophets and explaining all of these things to them ( Luke 24:26-27 ). So it is necessary for us to understand this as well so we know without a doubt that Jesus is who He said He is.
I hope this answers your questions and gives you some references to look up and study. I am actually in the process of putting together an whole study on all of these references, I hope to post it to my blog very soon.