Q:

Free will in Dante's Divine Comedy

I am reading Dante's Divine Comedy. In many cantos, souls predict Dante's future, and it is said that God knows everything past, present and future and that souls can enter heaven only if they are chosen by God with his grace.
I wonder where is free will in all this?

A:

The following lines in Canto III of Paradiso appear to discuss this (quoted from the translation provided by WorldOfDante):

The essence of this blessed life consists 
in keeping to the boundaries of God’s will,
through which our wills become one single will;
so that, as we are ranged from step to step
throughout this kingdom, all this kingdom wills
that which will please the King whose will is rule.
And in His will there is our peace: that sea
to which all beings move—the beings He
creates or nature makes—such as His will.”

In other words, Christians should align their will with God's. But how does this make them free? Compare or contrast the above passage with Romans 6, 12-14 (quoted from the King James Version):

Let not sin therefore reign in your mortal body, that ye should obey it in the lusts thereof.
Neither yield ye your members as instruments of unrighteousness unto sin: but yield yourselves unto God, as those that are alive from the dead, and your members as instruments of righteousness unto God.
For sin shall not have dominion over you: for ye are not under the law, but under grace.

This passage appears to say that it is sin that enslaves you and will prevent you from attaining grace.
Another motif in the Bible that seems relevant to grace and free will is that the individual needs to respond to a call by God. There are several Bible passages that illustrate this, for example:

And ere the lamp of God went out in the temple of the LORD, where the ark of God was, and Samuel was laid down to sleep; That the LORD called Samuel: and he answered, Here am I. (1 Samuel 3: 3-4, admittedly rather literal here)

The kingdom of heaven is like unto a certain king, which made a marriage for his son, And sent forth his servants to call them that were bidden to the wedding: and they would not come. (...) (Matthew 22: 2-...)

No man can come to me, except the Father which hath sent me draw him: and I will raise him up at the last day. (John 6:44)

This implies that people have the freedom to choose whether to answer God's call or not, and thereby implies free will.
Admittedly, none of the above passages address the conflict between God's omniscience and man's free will head on. It would seem that neither early Christians nor medieval believers saw a conflict; they seem to have accepted that when God created man, he gave him free will, and that was sufficient.
On Philosophy Stack Exchange someone drew a comparison between God's omniscience and the knowledge of a chess grandmaster:

The chess grand-master may well brag that he shall checkmate the novice chess player's king with a specific piece and reliably carry out that brag. In no case was the novice's free will violated, but the brag was true all the same.

This is a clever comparison: it resolves the conflict by assuming that God can manipulate the boundaries within which humans move; within these boundaries, humans still have free will. However, based on the above findings, one should ask whether this assumes a willingness to find contradictions in the Bible that believers may not have cared for.

