I am canceling my current email account, but I would like to keep the bulk of the messages that are in my inbox.
How can I extract the inbox messages to my new account or at least to document/text files, so that I can have them for my own records?
Essentially what you want to do is set up a third-party email client (Thunderbird is great for this, but you can use just about anything that supports IMAP) and configure it to use both your old and your new email accounts.
Then you can simply drag-and-drop all the messages you want to keep out of the old account inbox into the new account inbox. This will keep your attachments as well.
Once done (and you've confirmed your messages are in the new account), you can remove the old account from Thunderbird and then cancel the account.
I've done this once or thrice, and Thunderbird is dead simple to configure with Gmail.