FLEX is a reduced thrust setting for takeoff that decreases wear on the engines and prolongs engine life. It is achieved by telling the FMGC to behave as though the outside air temperature is higher than it really is.
Sometimes it is not a good idea to do this, for example if the OAT is really high, you have a short runway, very high elevation, or high weight. All of these things suggest that you should use full power (TOGA).
FLEX is calculated by adjusting ISA (15°C) for elevation (you subtract 1.98°C for every 1000ft) and then adding the result to the actual OAT.