By the formula PV/T = PV/T,
If there is a piston, and it compresses, so the volume gets smaller, the temperature will go down too..
But, I think if the volume gets smaller, the space is smaller, so the gas particle will collide more frequently, which makes the temperature goes up.
And, my logic...