There was an error in my pseudocode.
It says "i" should run from 0 to "last".
Actually, "i" should start at 0, but the loop should continue while first <= last.
Here's a rewrite of the code you have so far:
Code:
int cleanSpace( char s[])
{
    int i = 0,      // general loop index
        first = 0,  // first non-whitespace character
        last = 0;   // last non-whitespace character

    // loop to find the first non-whitespace character
    // and save its position as 'first'.
    for (i = 0; s[i] != '\0'; i++)
    {
        if (!isspace(s[i]))
        {
            first = i;
            break;
        }
    }

    // loop to find the last non-whitespace character
    // and save its position as 'last'.
    for (i = strlen(s) - 1; i > first; i--)
    {
        if (!isspace(s[i]))
        {
            last = i;
            break;
        }
    }

    // for loop to copy all characters in string 's'
    // between 'first' & 'last' to local string 'temp'.
    for (i = 0; first <= last ; i++)
    {
        s[i] = s[first];
        first++;
    }
    s[i] = '\0';

    return strlen(s);
}