How do variables work in this proof? How does this proof work?
Theorem.$\quad$Let $G$ be a group. Then $G$ has a unique identity.  
Proof.$\quad$Assume that $e$ and $f$ are two identities in $G$. Since $e$ is 
an identity, $ef=f$; and since $f$ is an identity, $ef=e$. Thus $e=ef=f$.  
I think need to get my understanding of variables sorted out, because when I read the first line of the proof I picture $e$ as an object different from $f$ and it's confusing to then read the conclusion that $e$ and $f$ are equal. Also, how does this show that $G$ has a unique identity?
 A: Having a unique identity means exactly that such scenarios when there are really two different identities cannot occur, and that's what is proven here: assuming letters $e$ and $f$ both denote identities in the same group $G$, we arrive that $e=f$ must hold, due to the definition of an identity.
Note also that in this proof actually we only used that $e$ is a left identity and $f$ is a right identity. 
That said, we also proved that whenever a binary operation has both a left and a right identity, then they are equal, and in this case any left identity and any right identity must be the same.
A: This is called a proof by contradiction. Your goal is to show that you have a unique identity element, and the way you go about proving this is by assuming you don't have a unique identity, i.e you have at least two. 
Suppose you have two distinct identity elements $e$ and $f$. Then as you showed above, $e=f$ which contradicts your assumption that $e$ and $f$ are distinct and so your group has a unique identity. 
