Diameter of set in metric space I do agree with the statement that
$$d(A) = \sup{\{d(x, y):x, y \in A\}}$$
But why can't we use maximum because according to me its max will also give diameter. 
I know it should not be correct, so please give me the correct explanation with example where the $\max$ formulation will be wrong.

It is possible for the supremum of a set to be a value that is not in the set, and as a result the set has no maximum value (since the maximum of a set is always taken to be the largest element in the set).
For a simple example, consider the open interval $A = (0, 1) = \{x \in \mathbb{R}: 0 < x < 1\}$. What's the largest distance two elements of $A$ can be? It's not 1, because there are no elements in $A$ that are 1 apart (since 0 and 1 aren't elements of $A$). However, for any distance less than 1, you can find two elements of $A$ that are further apart than that. In fact, the set of distances is equal to $[0, 1) = \{x \in \mathbb{R}: 0 \le x < 1\}$.
Since 1 is not an element of that set, the maximum of the set cannot be 1. However, it also cannot be any number less than 1, since there is always a larger number than it in the set. Hence, the set has no maximum value. However, the set does have a supremum, and the value of that supremum is 1.
