Set theory: cardinality of a subset of a finite set. 
Suppose $A$ is a finite set of cardinality $n$. And Let $B$ be a subset of $A$ and the cardinality of $B$ equals $n$. Then $B=A$. 

Many texts use this fact very frequently but it seems that they just take it for granted. How can I prove this rigorously? Any help will be appreciated.
 A: Since $B \subseteq A$, we can partition $A = B \cup (A \setminus B)$. These sets are disjoint. Taking cardinalities, we see $n = n + \left|A \setminus B\right|$, which implies $|A \setminus B| = 0$, hence $A \setminus B = \emptyset$, so $A = B$.
A: You have hit on a very subtle point, which many people can miss when they first run into this issue. Yes, we need to prove these things.
This is a consequence of the pigeonhole principle. If $B\subseteq A$, and $A$ is finite, then either $A=B$ or else there are no injective functions from $A$ into $B$; but if $|A|=|B|$ then by definition there is a bijection from $A$ into $B$.
So this, in turn, becomes a question as to how to prove the pigeonhole principle. The answer is by induction on the number of elements, and you can find a complete proof here.
A: Let's prove the contrapositive statement.  Suppose that $A$ has a proper subset with the same cardinality as $A$ (in other words, $A$ is Dedekind infinite.)  We will show that $A$ is infinite.
Take a proper subset $B$ of $A$ with the same cardinality as $A$.
  Then there is a bijection $f : A \to B$ and an element $a \in A \setminus B$.  Recursively define a function $h : \mathbb{N} \to A$ by


*

*$h(0) = a$

*$h(i+1) = f(h(i))$.


Using the fact that the function $f$ is injective and its range does not contain $a$, one can prove by induction on $j \in \mathbb{N}$ that the elements $h(0),\ldots,h(j)$ are distinct, so $h$ is an injection from $\mathbb{N}$ to $A$.
The existence of such an injection means that $\left|A\right| \ge \aleph_0$, so $A$ is infinite.
(There is a detail hiding here, namely the fact that there cannot be an injection from $\mathbb{N}$ to a finite set.  This can be proved by induction on the cardinality of the finite set by an argument similar to the one that Asaf mentions.)
