Wordpress - How to obtain the user ID of the current profile being edited in WP-Admin?

There is a global variable called … $user_id available on that page. Always.

From user-edit.php:

$user_id = (int) $user_id;
$current_user = wp_get_current_user();
if ( ! defined( 'IS_PROFILE_PAGE' ) )
    define( 'IS_PROFILE_PAGE', ( $user_id == $current_user->ID ) );

if ( ! $user_id && IS_PROFILE_PAGE )
    $user_id = $current_user->ID;
elseif ( ! $user_id && ! IS_PROFILE_PAGE )
    wp_die(__( 'Invalid user ID.' ) );
elseif ( ! get_userdata( $user_id ) )
    wp_die( __('Invalid user ID.') );

A little simplified. I didn't have access to a $user_id variable.

// If is current user's profile (profile.php)
if ( defined('IS_PROFILE_PAGE') && IS_PROFILE_PAGE ) {
    $user_id = get_current_user_id();
// If is another user's profile page
} elseif (! empty($_GET['user_id']) && is_numeric($_GET['user_id']) ) {
    $user_id = $_GET['user_id'];
// Otherwise something is wrong.
} else {
    die( 'No user id defined.' );
}