If two finite groups on the same set have the same homomorphisms in and out, must they be the same group? Let $X$ be a finite set and let $*,*'$ be binary operators on $X$ such that $(X,*)$ and $(X,*')$ are both groups.
First, assume that for each finite group $(H,\cdot)$ and for each map $f:H\rightarrow X$, $f$ is a homomorphism from the group $(H,\cdot)$ into the group $(X,*)$ if and only if $f$ is a homomorphism from the group $(H,\cdot)$ into the group $(X,*')$.
Second, assume that for each finite group $(H,\cdot)$ and for each map $f:X\rightarrow H$, $f$ is a homomorphism from the group $(X,*)$ into the group $(H,\cdot)$ if and only if $f$ is a homomorphism from the group $(X,*')$ into the group $(H,\cdot)$.
Must $*$ and $*'$ be the same binary operator? That is, must it hold that $\forall a,b\in X, a*b=a*'b$.
 A: As Joshua has noted in the comments, this is true. You're also onto a useful insight for the rest of your mathematical career: we can understand an object itself (up to isomorphism) by understanding the morphisms to/from it.
Let's see why this particular result is true:
Say $(H,\cdot) = (X,\ast)$ and $f : H \to X$ is the identity map. Then by your condition, $f : (X,\ast) \to (X, \ast')$ is also a homomorphism. Similarly, taking $(H,\cdot) = (X, \ast')$ we see the identity map is also a homomorphism in the other direction. That is:
$$(X, \ast) \overset{\text{id}}{\longrightarrow} (X, \ast') \overset{\text{id}}{\longrightarrow} (X, \ast)$$
Since $\text{id} \circ \text{id} = \text{id}$ we see these maps are inverse, and so $(X,\ast) \cong (X, \ast')$. In fact, since the identity map is the isomorphism, we see
$$a \ast b = \text{id}(a \ast b) = \text{id}(a) \ast' \text{id}(b) = a \ast' b$$
so the operations must agree exactly.
As a (fun?) exercise can you use a similar argument if we work with the condition that maps from $(X, \ast) \to H$ are the same as maps $(X, \ast') \to H$? The same idea works, but it will be good for you to go through it.

As an aside, this theorem is a special case of the famous (infamous?) Yoneda Lemma. Roughly, the Yoneda Lemma (one version of it at least) says that in very general settings, this idea always works.
That is, if you have two objects $A$ and $B$, and you know that they have "the same" morphisms to them (or from them) then $A \cong B$. Here the notion of "the same" morphisms is slightly more general than the strict equality that you've asked for (it's the notion of a natural isomorphism) but morally the same idea is at play.

I hope this helps ^_^
