Let $X$ be a finite k-regular graph. Fix a vertex $x_0$ and, for $r <\frac{g(X)}{2}$, consider the ball centered at $x_0$ and of radius r in X. Show that it is isometric to any ball with the same radius in the $k$-regular tree $T_k$. Compute the cardinality of such a ball.
I have no clue.
I think in question $r<\frac{g(X)}{2}$ should be $r<[\frac{g(X)-1}{2}]$ where $[x]$ is the greatest integer number below $z$. As for enough big $k$, we can have a path in $B(x_0,r)$ with length $1+r+r$ and if $g(X)$ be an odd number then with ex-bound of $r$ in question, the length of this path will be $1+[\frac{g(X)}{2}]+[\frac{g(X)}{2}]=g(X)$ and we may fail. But with the new bound this case never happens. Also your example in comments shows that without putting any condition on $k$, this new bound on $r$ is sharp for your isomorphism.