Can't get 2 variables to work globally - out of scope error and ThingSpeak error

In the program's main loop{} you have this line:

int averageTemp = total / numReadings; // calculate the averageTemp:

That makes a new local variable called averageTemp. It's not the same as your global averageTemp.

You should have put just:

averageTemp = total / numReadings; // calculate the averageTemp: