I assume you are talking about complex $n\times n$ matrices. This is not true in general within real square matrices.
A simple proof goes by functional calculus. If $A$ is invertible, you can find a determination of the complex logarithm on some $\mathbb{C}\setminus e^{i\theta_0}[0,+\infty)$ which contains the spectrum of $A$. Then by holomorphic functional calculus, you can define $B:=\log A$ and it satisfies $e^B=A$.
Notes:
1) There is a formula that says $\det e^B=e^{\mbox{trace}\;B}$ (easy proof by Jordan normal form, or by density of diagonalizable matrices). Therefore the range of the exponential over $M_n(\mathbb{C})$ is exactly $GL_n(\mathbb{C})$, the group of invertible matrices.
2) For diagonalizable matrices $A$, it is very easy to find a log. Take $P$ invertible such that $A=PDP^{-1}$ with $D=\mbox{diag}\{\lambda_1,\ldots,\lambda_n\}$. If $A$ is invertible, then every $\lambda_j$ is nonzero so we can find $\mu_j$ such that $\lambda_j=e^{\mu_j}$. Then the matrix $B:=P\mbox{diag}\{\mu_1,\ldots,\mu_n\}P^{-1}$ satisfies $e^B=A$.
3) If $\|A-I_n\|<1$, we can define explicitly a log with the power series of $\log (1+z)$ by setting $\log A:=\log(I_n+(A-I_n))=\sum_{k\geq 1}(-1)^{k+1}(A-I_n)^k/k.$
4) For a real matrix $B$, the formula above shows that $\det e^B>0$. So the matrices with a nonpositive determinant don't have a log. The converse is not true in general. A sufficient condition is that $A$ has no negative eigenvalue. For a necesary and sufficient condition, one needs to consider the Jordan decomposition of $A$.
5) And precisely, the Jordan decomposition of $A$ is a concrete way to get a log. Indeed, for a block $A=\lambda I+N=\lambda(I+\lambda^{-1}N)$ with $\lambda\neq 0$ and $N$ nilpotent, take $\mu$ such that $\lambda=e^\mu$ and set $B:=\mu+\log(I+\lambda^{-1}N)=\mu+\sum_{k\geq 1}(-1)^{k+1}\lambda^{-k}N^k$ and note that this series has actually finitely many nonzero terms since $N$ is nilpotent. Do this on each block, and you get your log for the Jordan form of $A$. It only remains to go back to $A$ by similarity.
6) Finally, here are two examples using the above:
$$
\log\left( \matrix{5&1&0\\0&5&1\\0&0&5}\right)=\left(\matrix{\log 5&1&-\frac{1}{2}\\ 0&\log 5&1\\0&0&\log 5} \right)
$$
and
$$
\log\left(\matrix{-1&0\\0&1} \right)=\left(\matrix{i\pi&0\\0&0} \right)
$$
are two possible choices for the log of these matrices.
Best Answer
It's a standard result from introductory linear algebra that, by multiplying by elementary matrices, you can row reduce any matrix into row reduced echelon form.
In the case of an invertible matrix, the row reduced echelon form is the identity matrix, which is also an elementary matrix, and so you get the theorem.