If you look on a map, you'll see that CDG (Charles de Gaulle airport) is northeast of Paris, whereas Versailles is southwest. I don't think there is a good way to ride from CDG to Versailles. I would recommend that you take the RER from the airport to Versailles. (If you happen to be arriving on a weekend, then you might consider riding.) You can take your bike on RER trains except for rushhour Mon-Fri. All day on weekends is OK. You'll need to transfer at St. Michel.
You will find much nicer places to ride if you start from Versailles. If you've got time for a longer ride, bike to Chartres. For a shorter ride, the Rambouillet forest.