In case you're going to say that DFP actually supports the 'fluid' ad size, you would be right, but this ad size does not work when using DFP with AdSense as a fallback. Further, the 'Smart Banner' ad style is only available for mobile, so that's a no go either.
The image below shows the desired results. I wanted to be able to select the most appropriate ad size for any given container based on that container's width. This isn't exactly responsive but if your container is the width of your page it is as close as it gets. This approach works very well if you don't expect ads to resize if the browser window is resized. The ad size is picked when the ad is first inserted into a page and remains static, this still allows the same responsive page to contain ads that work equally well on desktop as on mobile.
So lets see how you can implement this. The first step is to select all of the possible ad sizes. I think horizontal banner sizes work best so that's what I did for my example. This is done in the DFP Inventory console for the ad unit you wish to use on your page.
Now for some HTML. This creates an 800px container DIV with another DIV element inside that will hold the DFP ad slot.
Don't forget to include DFP code inside the <head> element.
Everything so far has been setup and initialisation. The makeDfpSlot() function is where all the real magic happens. That function looks like this:
What the above function does is find the DFP slots's DIV parent width. Then, based on that width and the ad sizes configured in the dfpSizes array it picks the largest ad size that would fit inside the parent container. Once the ad size is picked, the DFP slot DIV dimensions are adjusted, a new slot is created and refreshed so an ad will show.
You can find a fully worked example of the above on my GitHub repository here.
This is more work than standard AdSense code but if you combine it with infinite scroll pages it becomes very powerful. I've also wrote another article on how to Insert Google DFP ads with Backbone, Underscore and jQuery.