Flexible and stretchable temperature sensors have recently gained much attention due to their lightweight, thin profile, and ability to adapt to curved or irregular surfaces. Resistive temperature detectors (RTD) are one of the most commonly used sensors for temperature measurement. However, the major challenge with developing RTDs on flexible substrate is that the resistance not only changes with temperature, it also varies with mechanical deformation of the substrate, which can lead to significant errors in temperature measurement. In this paper we propose a novel flexible temperature sensor that can compensate for the deformation-induced resistance variation and measure temperature with minimum errors. The sensor is composed of two RTDs fabricated back-to-back on a polydimethylsiloxane (PDMS) substrate via stencil printing. The dual RTD configuration provides compensation against mechanical deformation caused by bending and stretching. When the sensor is bent on a curved surface, the resistances of the two RTDs change differentially due to tension on one RTD and compression on the other. As a result, the sum of resistance of both RTDs, RSum, remains a constant. Similarly, the subtraction of resistance of the two RTDs, RSub, can be used to compensate for the linear resistance change in sensor stretching. With the compensation methods in place, the sensor can be used for temperature measurement with enhanced accuracy. In addition, the sensor is connected to a Bluetooth-integrated microcontroller which is programmed to determine whether the sensor is undergoing bending or stretching. The compensation methodology can provide reliable measurement for a maximum radius of 40 mm when the sensor is bent or a maximum strain of 3% when it is stretched. The compensation method enhances the competence of flexible temperature sensors and increases their potential for applications in wearable electronics.