Check if user registration field is set to visible or hidden on the registration form
If you look at the code of user_register_form(), you will notice it uses the following code.

  foreach (field_info_instances('user', 'user') as $field_name =&gt; $instance) {
    if (empty($instance['settings']['user_register_form'])) {
      $form[$field_name]['#access'] = FALSE;
    }
  }


If you are implementing hook_form_alter() (or other similar hooks), it's quite easier to look at the #access property. If you need that in other functions, you can use code similar to the following one.

  foreach (field_info_instances('user', 'user') as $field_name =&gt; $instance) {
    if (empty($instance['settings']['user_register_form'])) {
      // $field_name is not supposed to be added to the account registration form.
    }
  }


Clearly, checking for the #access property in a hook_form_alter() implementation is the safer method, since it consider the field can be made accessible from third-party modules (or third-party modules can hide a field that should be visible).
The other method is more for getting a specific field setting.