Recently, I was listening to The Bible Answer Man and a caller had asked a question about whether or not we could have free will in light of God's foreknowledge of what we would do. The caller spent a few minutes on the air with Hank going back and forth about whether this was an issue and whether God's knowing a future event without the ability to be wrong about it means that the event is pre-determined and could not be any other way.
For Hank's response, I would invite you to listen to the show from 5/26/2016. For my part, I would like to spend a few minutes taking a slightly different approach to this question. As is usually the case, this response is not solely made up of my own brilliant ideas, but is derived from responses I have heard from others in the past on this subject.
It seems to me, the important distinction that has to be made here is between logical and chronological priority. In my mind, a better understanding of these two concepts makes this question quite easy to resolve. So, let's take a look a the difference(s) between these concepts.
In our normal, everyday lives, when we talk about some event being prior to some other event, what we mean is that event A took place at an earlier time than event B. So, event A takes place, then some amount of time passes and then event B takes place. In most cases, this is how cause and effect works. A billiard ball is struck with a cue and then the cue ball strikes another billiard ball, setting that ball into motion. We not only recognize the cause and effect, but we also see that each event takes place one before the other in the same order as the cause and effect chain. We recognize that the initial cause is the cue hitting the first billiard ball, setting it into motion. After some (very small) amount of time, the first ball hits the second which causes it to move.
It's a pretty basic example, but it seems pretty clear. Cause...then effect...then leads to another cause, then effect, etc. This is how things usually work and, as a result, our minds recognize this pattern even if we are not consciously aware of it. This is what we refer to as "chronological priority." The cause comes earlier in time, or perhaps at the exact same time, than the effect. In this situation, the effect can never come before the cause.
However, the other option is known as "logical priority." I would say that chronological priority is a subset of logical priority, but I don't want to get too far into the weeds about this. Let's just look at what it means to be logically prior...
This may not be the greatest example, but it's the best I could come up with. Imagine that you are planning to visit a particular town in two weeks and you will be visiting a particular museum. Since you have a friend who lives in that area whom you haven't seen in quite some time, you let them know that you will be at that museum on a specific day. When you get to the museum, your friend is there waiting for you.
Now, what caused that person to be at that museum at that time? One could argue that they are there to see you...but they had to start heading there before you were there. So, leaving their house to go to that place at that time was all done because you were going to be there. Your presence there was chronologically after they went there to meet you, but logically, it was the cause of your friend being there to meet you.
In a similar way, this is how God's foreknowledge works. When God knows what you will do in the next 10 minutes, you don't do that thing 10 minutes from now because God knows it. It's the other way around. Because you will have done that thing in 10 minutes, God knows that you are going to do it. It is your free will choice if you want to raise your arm over your head right now and God knows what that free choice will be. He has known it from eternity past. It doesn't mean that you must raise or not raise your arm. It merely means that whichever of the two you freely choose to do, God will have known that all along. If you choose to raise your arm, God will have known it, but if you choose not to, He will have known that.
In the same way that a barometer can predict whether or not it will rain, but can't cause it to rain, God knows what choices you will make, though His knowledge doesn't cause those choices. The main difference between my analogous barometer and God is that the barometer could be wrong. But even if it's right and it accurately predicts the rain, we know that it didn't cause the rain. Now that I think of it...maybe I should have led with that.
For further reading on this topic, see the following resources:
If God knows our free will choices, do we still have free will? - Matt Slick
Does God's knowledge eliminate free will? - Closer to Truth
Foreknowledge and Free Will - Internet Encyclopedia of Philosophy