Regarding the login form within the header of a page.
What you describe is of course entirely possible, it shouldn't really be any trickier that your primary login form.
What I would start with is ensuring that the post data from the header form is actually being received properly when submitted to your 'user/login' controller/method. Simply put the following code at the start of your 'user/login' controller and method:
Code:
echo '<pre>';
print_r($_POST);
exit;
If that is receiving the data properly, just ensure that you direct the flow of data to the flexi auth login function - just like you suggest is happening via the primary login form.
--
Regarding whether there is a specific function to return the username - no there isn't.
If your flexi auth primary identity column was setup as the username, then the get_user_identity() function would do this, but you state that the users email is the primary identity.
Therefore, probably the easiest way to return the username is via the get_user_by_id() or get_user_by_identity() functions.