$n$ vectors in $\mathbb{R}^n$ and an $n \times n$ matrix, linear independence proof. I need help with the following problem:

Let $x_1,x_2,\ldots,x_n$ be vectors in $\mathbb{R}^n$ and let $A$ be an $n\times n$ matrix. Show that if $Ax_1,Ax_2,\ldots,Ax_n$ are linearly independent, then $x_1,x_2,\ldots,x_n$ are linearly independent and that $A$ is invertible.

My progress:
It's easy to apply the definition of linear independence and deduce that the only solution to the equation $c_1Ax_1+c_2Ax_2+\cdots+c_nAx_n=0$ is $c_1=c_i=0$. This is where I get stuck, can we just factor out $A$ from every term of the equation and say that then vectors $x_i$ are linearly independent? Also how can we claim that $A$ is invertible?
 A: Let $X$ be the $n \times n$ matrix whose $i$-th column is the column vector $\mathbf x_i$. Let $B$ be the $n \times n$ matrix whose $i$-th column is the column vector $\mathbf Ax_i$. Then $$AX=B$$, so $$\det(A)\det(X)=\det(B)$$. Since the vectors $A\mathbf x_i,...,A\mathbf x_n$ are linearly independent, $\det(B) \ne 0.$ Thus $\det(A) \ne0, \det(X)\ne 0$ and hence $A$ is invertible and the vectors $\mathbf x_1, ...,\mathbf x_n$ are linearly independent.
A: For proving that $x_1,\dots,x_n$ are linearly independent, you have to work backwards. So, fill in the details in the following proof.
Proof: Let $c_1,\dots,c_n$ be scalars such that $c_1x_1+\dots+c_nx_n=0$. Then multiply by the matrix $A$ on both sides to get $$A(c_1x_1+\dots+c_nx_n)=0$$ Now use the linearity of matrices to conclude that $c_1=\dots=c_n=0$ and thus $x_1,\dots,x_n$ are linearly independent.

To prove that $A$ is invertible, you can use the rank-nullity theorem or just prove that $A$ is injective and surjective. Both require the previous result that $x_1,\dots,x_n$ are linearly independent. This is because if $x_1,\dots,x_n$ are linearly independent, then they form a basis of $R^n$.
You can easily use rank nullity if you have been introduced to it. You can either prove that $A$ is injective or surjecitve and then use rank nullity. Use the easy to prove result that $A$ is injective if and only if null$(A)=\{0\}$ to conclude that $\dim \text{ null}(A)=0$.
If you have not been introduced to rank nullity, then simply prove that $A$ is injective and surjective. So, fill in the details in the following proof.
Proof: Let $x\in R^n$ such that $Ax=0$. Using the result that $x_1,\dots,x_n$ is a basis of $R^n$, there exist scalars $a_1,\dots,a_n$ such that $x=a_1x_1+\dots+a_nx_n$. Thus, we have that $$A(a_1x_1+\dots+a_nx_n)=0$$ Now use the linearity of $A$ to conclude that null$(A)=\{0\}$ and thus $A$ is injective.
To prove that $A$ is surjective, let $b\in R^n$. Given that $Ax_1,\dots,Ax_n$ are linearly independent, they form a basis of $R^n$. Thus, there exist scalars $c_1,\dots,c_n$ such that $$c_1Ax_1+\dots+c_nAx_n=b$$ Now use the linearity of $A$ to get that $$A(c_1x_1+\dots+c_nx_n)=b$$ Because $x_1,\dots,x_n$ is a basis of $R^n$, we conclude that for every $b\in R^n$, there exists an $x\in R^n$ such that $Ax=b$. In particular, this $x$ is given by the scalars $c_1,\dots,c_n$.
