Question: Did the demon-possessed girl in Acts 16:16 have the ability to tell the future, and, if so, how can demons know the future?
Response: According to the text of Acts 16:16, this girl had a pneuma python, that is, a "python-type spirit" in her. In classical mythology, the python was the snake Apollo killed when he took over the Delphic shrine. Therefore the word "python" in this context would definitely have been understood by the readers of Acts to relate to the cultic rite of that place (i.e., Delphi). Delphi was, of course, the most famous prophetic oracle in antiquity. There, the "mantis" or prophetess would be inspired (by the "god", it was assumed) from the fumes that proceeded from the earth, and then give out oracular responses to those who sought the god's counsel.
What all this means for Acts 16:16 is that the "prophecy" this girl gives is a "forth-telling" as much as a "fore-telling". The Delphic oracle's prophecies were almost always obscure, and often gave the god's consent or rejection of a proposed course of action (so that no precise vision of the future would be necessary). They were given in verse form, and the inspired state of the oracle herself was said to have been impressively frenetic and ecstatic.
In the case of this prophetess, therefore, those who sought information from her will likely have been as much impressed with the delivery and form of the response as with the information itself, accompanied as it was (as we may assume from the context and from her title) by a frenetic, "inspired" state, and perhaps even by a ventriloquist-like projection of her voice.
From the biblical description here, we are clearly being given to understand that a demon spirit is empowering this strange behavior that attracts pagan interest, attention, and money. But you are quite right in your supposition that demons do not know the future anymore than we do. They know what God has chosen to reveal (as we do). However, it should not be surprising that this demon-possessed woman was able to impress her contemporaries with her oracles. Even today, charlatans of this ilk are well versed in discerning general patterns and making predictions which come true (without, however, really being more than educated guesses). A demon-possessed person would have the advantage, especially in the ancient world, of access to information that might take a long while to reach the individual inquiring of the medium. For example, if a man wants to know if his wife on the other side of the Aegean has had a child, it may already have happened (so that it is not in the future), but in human terms such information will take time to arrive while the demon might procure it in short order (angelic creatures being vastly more mobile than we are). Then too, Satan's agents might try to make something "come true" if the issue were important enough (this sort of thing, of course, is subject to the over-ruling will of God, especially in case believers are involved).
So by casting out this demon, the woman was no longer capable of 1) acting possessed; 2) garnering information not easily available to anyone; 3) producing mysterious sounding responses. In short, she was of no further use to her employers. She had been of great use as a money-maker, but not because she could really see the future.
For more on the subject of demon possession, see The Satanic Rebellion: Background to the Tribulation: Part 4 "Satan's World-System, Past, Present and Future", section V.4, "Demon Possession".
In Him who is our future and the only truth, our Lord Jesus Christ.