How to make first_name and last_name required fields in user profile?

You could check the $_POST variable when updating the user profile page.

I would hook into user_profile_update_errors and do something along those lines. This filter will not save to DB if errors are found.

add_filter('user_profile_update_errors', 'wpse_236014_check_fields', 10, 3);
function wpse_236014_check_fields($errors, $update, $user) {

  // Use the $_POST variable to check required fields

  if( empty($_POST['first_name']) )
    // add an error message to the WP_Errors object 
    $errors->add( 'first_name_required',__('First name is required, please add one before saving.') );

  if( empty($_POST['last_name']) )
    // add an error message to the WP_Errors object 
    $errors->add( 'last_name_required',__('Last name is required, please add one before saving.') );

  // Add as many checks as you have required fields here

  if( empty( $errors->errors ) ){

    // Save your custom fields here if no errors are found
    // Just skip this if you don't need to do extra work.
    // Fields will save if no errors are found

  }


}

EXTRA

There is also 2 hooks that you could use when saving custom fields added to the profile page. I’ll refer you to the codex if you want more specifications as I’m pretty sure you won’t need those for your specific use case as I believe WooCommerce custom fields should appear in the $_POST variable as well.