$BG$ is a diagonal along one face of the cube. Since this diagonal splits the square face into two $45-45-90$ triangles, the diagonal is $\sqrt{2}$ times longer than a side of the square, so a side of the square measures $5\sqrt{2}/\sqrt{2}=5$ units. Thus, the volume of the cube is $5^3=125$ cubic units.
The figure shown is a cube. The distance between vertices $B$ and $G$ is $5\sqrt{2}$ units. What is the volume of the cube, in cubic units?

[asy]

size(3cm,3cm);

pair A,B,C,D,a,b,c,d;

A=(0,0);
B=(1,0);
C=(1,1);
D=(0,1);

draw(A--B--C--D--A);

a=(-0.25,0.1);
b=D+(A+a);
c=C+(A+a);

draw(A--a);

draw(D--b);

draw(C--c);

draw(a--b--c);

draw(A--b,1pt+dotted);

label("$B$",b,W);
label("$G$",A,NE);

dot(A);
dot(b);

[/asy]