We present a comprehensive study of the optical characteristics of AlxGa1-xN epilayers (0 less than or equal to x less than or equal to 0.6) by means of photoluminescence (PL), PL excitation, and time-resolved PL spectroscopy. For AlxGa1-xN with large Al content, we observed an anomalous PL temperature dependence: (i) an "S-shaped'' PL peak energy shift (decrease-increase-decrease) and (ii) an "inverted S-shaped" spectral width broadening (increase-decrease-increase) with increasing temperature. We observed that the thermal decrease in integrated PL intensity was suppressed and the effective lifetime was enhanced in the temperature region showing the anomalous temperature-induced emission behavior, reflecting superior luminescence efficiency by suppressing nonradiative processes. All these features were enhanced as the Al mole fraction was increased. From these results, the anomalous temperature-induced emission shift is attributed to energy rail states due to alloy potential inhomogeneities in the AlxGa1-xN epilayers with large Al content.