Make the function return a string instead of void and put
at the end.
Then in the loop, create a variable to hold the string and use the function to get it.
String temperature_message = Temerature();
That absolutely will NOT work. When temperature ends, the message variable goes out of scope, which means that the memory it was using is available to be reused. Returning a pointer to that space is not a great idea.
What you do need to do is pass the function a reference to a String object that you want it to write to.
void temperature(String &dest)
dest = inString.substring(startCommand+1, stopCommand);
Then call the function:
Serial.print("temperature returned: ");
One thing that will trip you up is that the IDE fails to create function prototypes for functions that use reference arguments. You will either need to define the function before any calls to the function or create the function prototype yourself.
On the other hand, since everything
else that temperature() deals with is a global variable, it doesn't really make sense to try to make it deal with local variables, too.