I upgraded from the 3G to the iPhone 4 and forgot to backup and transfer my apps. If I attempt to purchase apps that I have previously purchased, will the Apple store charge me? Or will it recognize that I have already purchased the app based on my apple ID?
No, you will not be charged. You can re-download them in iTunes or directly on the phone. You'll have to hit the "buy" button, but after it starts downloading, you should see a message saying you already bought it once. The alert box includes a button to go ahead and re-download the app, which you will then not be charged for.
To re-download all your apps into iTunes.
iTunes will then check for what you have purchased before, and give you an option to re-download your purchased apps.
To see a listing of all the apps you have purchased or downloaded, do this :
You should now see all the apps you have downloaded before