(1) 证明:
$\because$ 四边形$ABCD$是正方形,
$\therefore AB=BC,$$∠ ABC=∠ CBG=90°,$
$\therefore ∠ E+∠ EAB=90°。$
$\because CF⊥ AE,$
$\therefore ∠ E+∠ ECF=90°,$
$\therefore ∠ EAB=∠ ECF。$
在$△ ABE$和$△ CBG$中,
$\begin{cases}∠ EAB=∠ GCB\\AB=CB\\∠ ABE=∠ CBG\end{cases}$
$\therefore △ ABE≌△ CBG(\mathrm{ASA})。$
(2) 解:
在$\mathrm{Rt}△ ABE$中,$AB=40\,\mathrm{cm},$$AE=50\,\mathrm{cm},$
由勾股定理得:$BE=\sqrt{AE^2-AB^2}=\sqrt{50^2-40^2}=30\,\mathrm{cm}。$
$\because △ ABE≌△ CBG,$
$\therefore BG=BE=30\,\mathrm{cm},$
$\therefore AG=AB-BG=40-30=10\,\mathrm{cm}。$