Is this T&P relief valve discharge pipe installed correctly?
Illegal. Your photo shows a TPV outlet pipe with a trap.  Last I checked, UPC 608.5 says "No part of such drain pipe shall be trapped ..."
Similarly, IPC (2012) 504.6 (8) Discharge piping serving a TPV shall  "Not be trapped."