It is easy to prove that △PME and △PNF are congruent, so PF=PE.
CP=√2, so CN=CM=PN=PM= 1.
FN= 1-x, CG is parallel to PN, so PN/CG = NF/CF.
CG=PN*CF/NF=x/( 1-x)
CE = CM+ME = CM+NF = 1+ 1-x = 2-x
EG=CG+CE
y=x/( 1-x)+2-x=(x^2-2x+2)/( 1-x)= 1-x+ 1/( 1-x)
Domain 0