解:由于△ADE沿AE对折至△AFE,那么△ADE≌△AFE,则AD=AF,DE=FE;
∵四边形ABCD为正方形,且AB=6,CD=3DE;
∴AB=AD=AF,且FE=DE=2;
而Rt△ABG与Rt△AFG共斜边AG;
∴Rt△ABG≌Rt△AFG(两直角三角形斜边与直角边相等推证全等),则BG=FG;
设CG=x,那么FG=BG=6-x,又CE=CD-DE=4,则在Rt△ECG中,有勾股定理得
x²+4²=(6-x+2)²
解得x=3,即CG=3.
....................................................