i have a relay that cuts in if the temp gets below 25 degrees, if it is fluctuating between 25/24.9 the heater will cut in and out every second. i normally set this to a higher value.
use 2 temperatures to prevent this behaviour.
pseudocode:
int state = LOW; // sort of OFF
void loop()
{
float temp = readTemperature();
if (temp > 25) state = LOW;
if (temp < 23) state = HIGH;
setHeater(state);
}