Why is this code using the global $user variable?
The code is not really using the global $user variable. Probably, the code was first using it, and that line has been left; it could also be the code using it was moved in mycaptcha_ask_form_validate(). 

As that line is just a variable declaration, there is no problem in leaving it, even if I generally remove it.