I apologize in advance for my proof seeming pedantic, but virtually every "proof" I have seen in textbooks, or posted online, is incorrect. The idea behind the proof is straightforward enough, but one must exercise great care in its execution. So here goes ...
Set $g=girth(G)$ and $d=diam(G)$. We need to prove that $g$ is at most 2d+1. By way of contradiction, assume that $g$ is at least $2d+2$.
Let $C$ be a $g$-cycle in $G$, with consecutive vertices $x_0, x_1, x_2,..., x_{g-1}$. Denote by $P_C$ a shortest path along $C$ that has end-vertices $x_0$ and $x_{d+1}$. Note that when $g>2d+2$ this path is uniquely defined, whereas for $g=2d+2$ there are two such shortest paths. In either case, we may always choose $P_C$ to be the path having consecutive vertices $x_0, x_1, x_2,...,x_{d+1}$.
Set $t=dist_G(x_0,x_{d+1})$, and let $P$ be a path in $G$ from $x_0$ to $x_{d+1}$ with consecutive vertices $y_0(=x_0), y_1, y_2,...,y_{t-1}, y_t(=x_{d+1})$. By definition of diameter, $t \leq d$.
Let $j$ be the minimum value for which $y_j \neq x_j$. (Note that this implies that $x_i = y_i \forall i < j$.) Such a $j$ must exist, since otherwise we would have $P=P_C$, a contradiction since $P$ and $P_C$ have different lengths.
Now, among all values strictly greater than $j$, let $k$ be the minimal value for which $y_k$ lies on $P_C$. Such a $k$ must exist because $y_t (=x_{d+1})$ lies on $P_C$.
Thus $y_k= x_m$ for some $m \leq d+1$.
Now suppose $m < j$. Then by minimality of $j$, we have $y_k=x_m=y_m$. But this is impossible since $k>j>m$, and a path cannot have repeated vertices. We conclude that $m \geq j$.
At this point, we may construct the cycle with consecutive vertices
$$y_j, y_{j+1},..., y_k(=x_m), x_{m-1}, x_{m-2},...,x_{j-1}(=y_{j-1})$$
The length of this cycle is $m-j+1+k-j+1$ which is smaller than $g$. The easiest way to see this, is to note that $x_{j-1}, x_j,..., x_m$ is a portion of the path $P_C$, hence its length is at most $d+1$. Also note that $y_{j-1}, y_{j},..., y_k$ is a portion of the path $P$, hence its length at most $d$. Thus this cycle has length at most $2d+1$, a contradiction to our assumption that $g$ is at least $2d+2$.
Best Answer
So when they say the 'maximum distance' between two points, they mean you choose $(x,y)$, find $d(x,y)$ which is the minimum length of the path between them, and then define the diameter $d_G=\sup_{x,y\in V(G)}d(x,y)$. That will give you $3$ here and not $5$. You see, the distance itself is already defined as the minimum path length, so you cannot change that. What you can do is find the maximum of this minimum over all pairs of points.