This will often depend on the context. * is by definition a binary function *:GxG→G, and a function is well-defined by definition.. I think the problem is best illustrated by examples:
Let G = {[x]: x is an integer not a multiple of 3}, where [x] = {integers y s.t. x~y}, where we write x~y if x and y leave the same remainder upon division by 3 (alternatively, x-y is divisible by 3). The elements of G are sets called equivalence classes of Z modulo 3, and we can easily verify that G={[1],[2]}. Now define a binary operation on G by [a]*=[ab]. At first glance it might not be obvious that * is well-defined since [a] and have many different representations, and [ab] might depend on which of these representations we choose. For example [2]=[5] and [1]=[31], so we better make sure that we get [2]*[1]=[5]*[31] with how we defined *! We can verify that [2]*[1]=[2]=[155]=[5]*[31], since 155 leaves remainder 2 upon division by 3. Indeed, we can prove that [a]*=[ab] gives the same element of G no matter how we choose to write [a] and , i.e. * is well defined!
Edit: G={[0],[1],[2]} is not a group ([0] is not invertible), edited so that G={[1],[2]}