How to programatically change a user image field to match the user's latest completed goal?
I finally found the answer thanks to the Devel module and the user_save API page! After investigating a random goal with dpm(goals_load(GOAL_ID));, I wrote the following code:

 function top_goals_completed_goal($goal_id, $uid) {
    $user = user_load($uid);
    $goal = goals_load($goal_id);
    $fid = $goal-&gt;goal_img['und'][0]['fid'];
    $img_title = $goal-&gt;goal_img['und'][0]['filename'];

    $edit = array();
    $edit['field_last_goal']['und']['0']['fid'] = $fid;

    user_save($user, $edit);
}