Off the top of my head, there are three very different techniques used to incorporate SE friendly URLs into a dynamic site.
The first, and in my opinion the best, is to have the script actually generating the dynamic content both parse and create the SE friendly URLs. There are a few ways to accomplish this, the most common being to use the PATH_INFO environment variable instead of referencing the query string. If an application is designed this way, it's easy. Converting an existing script, though, can be a little more difficult.
The second way, mentioned by Andy, is to let the server rewrite the URLs on the fly. Again, there are a few ways to do this, with mod_rewrite being the most common. The danger here is the additional load put on the server for every page requested. For sites with little traffic that can be ignored, for busier sites it's still rarely an issue, but for large sites with lots of pages it can potentially bring a server to its knees if you get hit by an aggressive spider. The spider thinks its requesting static pages and expects them to be returned with the usual speed of a static page. This is a problem with ANY of the methods for SE friendly URLs, but can be exacerbated by throwing mod_rewrite into the mix. It's not a deal-buster, but should be a concern. Make sure your hardware is up to the task.
The third way, also mentioned above, is to have an intervening script create the page. The usual choice is to install a custom 404 page, which is almost always even more resource-hungry than mod_rewrite. Additionally, the script has to be very carefully written to insure the correct status code is returned to the requesting agent. Send back anything except a 200 status and you've probably defeated the whole scheme.
Properly implemented, NONE of these three techniques should result in duplicate pages. The whole idea of these techniques is to both display and process URLs that have no ? query string. If you have two identical pages in Google, one SE friendly and one with a question mark, something is being done wrong.
Fortunately, there's still a very simple answer, at least for Google.
Google recognizes
certain extensions to the robots.txt file that can help eliminate the problem of having two identical pages indexed with differing URLs. Specifically, add the following:
User-agent: Googlebot
Disallow: /*? Doing so will prevent Google from indexing ANY page with a question mark in the URL.