You can solve the problem using Pythagoras theorem a^2 + b^2 = c^2
If AB= a and BC=b, then AC would be c. Since AB and BC are given, we can find the length of AC. The calculation would be:
c^2= a^2 + b^2
AC^2= AB^2 + BC^2
AC^2= 2^2 + 1^2
AC^2= 4+1 = 5
Using the same formula again you can determine AD length
c^2= a^2 + b^2
AD^2= AC^2 + CD^2
AD^2 = 5 + 1^2= 6
Repeating the process again, you will find out that
AE^2= 7
A.F^2=8
AG^2=9
Then, AG would be: √9= 3