Finding identity element and inverse element of a group I have a non-empty finite set X with the following associative binary operation: 
$ * : X \times X \to X , (x,y) \mapsto x * y $ such that:
1) $ x*z = y*z \Rightarrow x=y$
2) $ z*x=z*y \Rightarrow x=y$
I have to prove that $(X,*)$ is a group. Therefore, I have to find the inverse element and the identity element.
This was a problem from my abstract algebra class. The tutor gave a solution in which we define a function $f(x) = x*z$ which by the definition of the operation $*$ is injective and use it to find the elements. However, I could not follow the solution in class.
 A: First you have to find the identity of $X$. Pick any $z\in X$ and define
$$z^n=z*\cdots *z\mbox{ (n times)}$$
Note that this definition makes sense only when $n>0$.
Since $X$ is finite then there exists $n>m$ such that $z^n=z^m$ (that's because the sequence $z, z^2, z^3, \ldots$ has to start repeating at some point). Therefore for any $x\in X$ we have
$$z^n*x = z^m*x$$
And thus by the property (2)
$$z^{n-m}*x=x$$
Put $e:=z^{n-m}$. Note that definition makes sense since $n-m>0$. Thus we have
$$e*x=x$$
for any $x\in X$. We also have $x*e=x$ by the property (1). Thus $e$ is the identity.

Now to show the existence of the inverse what you need to know is that if $g:X\to X$ is a function with $X$ finite then $g$ is injective if and only if $g$ is surjective.
Let $f_z:X\to X$ be defined by $f_z(x)=x*z$. We will show that $f$ is injective. Indeed, assume that $f_z(x)=f_z(y)$. Thus $x*z=y*z$ so by the property (1) $z*x=z*y$ and thus by the property (2) $x=y$. $\Box$
Since $X$ is finite and $f_z$ is injective then $f_z$ is surjective. In particular there exists $x\in X$ such that 
$$f_z(x)=e$$
Thus by (1) we have
$$z*x=x*z=e$$
In particular $x$ is the inverse of $z$.
A: Injective functions on a finite set are surjective as well.
Fix some $z\in G$ and have a look at the (bijective) function prescribed by $x\mapsto x*z$. 
Some $u\in G$ must exists with $u*z=z$. 
Then $(u*u)*z=u*(u*z)=u*z$ and consequently $u*u=u$.
For every $x\in G$ there will exist some $y$ with $x=u*y$ so that $u*x=u*(u*y)=(u*u)*y=u*y=x$. 
Likewise you can find $v\in G$ with $x*v=x$ for every $x\in G$.
Finally $u=u*v=v$ and evidently this element serves as an identity on $G$.
Proving that every element has an inverse I leave up to you.
