The argument for identities is very simple: Assume we have a group G with a left identity g and a right identity h.Then strictly by definition of the identity:
g = gh = h.
So g=h. Q.E.D.
The argument for inverses is a little more involved,but the basic idea is given for inverses below by Dylan. Here's a straightforward version of the proof that relies on the facts that every left identity is also a right and that associativity holds in G. Assume x' is a left inverse for a group element x and assume x'' is a right inverse. Let h a 2 sided identity in G (note we did NOT assume it's unique!It in fact is,but we haven't proven that yet! Be careful!) Then:
x' = x'h = x'(xx'') = (x'x) x'' = hx''= x''. So x'=x'' and every left inverse of an element x is also a right. Q.E.D.