Where in the database does fieldset and field instance info live?
Whether a field is required or not can vary by content type (ie, the bundle).  I am pretty sure you need to use field_info_instances($entity_type, $bundle_name).  You can then use field_info_field($field_name) on the results.  Something like:

$fields_info = field_info_instances('node', $bundle);

foreach ($fields_info as $field_name =&gt; $instance) {
  $field_info = field_info_field($field_name);
}


dpm() both the $instance and $field_info.  Everything you need should be in those two variables.  This is a snippet from a dynamic exporter I have.