Let the matrix $A=[a_{ij}]_{n×n}$ be defined by $a_{ij}=\gcd(i,j )$. How prove that $A$ is invertible, and compute $\det(A)$? Let $A=[a_{ij}]_{n×n}$ be the matrix defined by letting $a_{ij}$ be the rational number such that $$a_{ij}=\gcd(i,j ).$$ How prove that $A$ is invertible, and compute $\det(A)$? thanks in advance 

There is a general trick that applies to this case.
Assume a matrix $A=(a_{i,j})$ is such that there exists a function $\psi$ such that
$$
a_{i,j}=\sum_{k|i,k|j}\psi(k)
$$
for all $i,j$.
Then 
$$
\det A=\psi(1)\psi(2)\cdots\psi(n).
$$
To see this, consider the matrix $B=(b_{i,j})$ such that $b_{i,j}=1$ if $i|j$ and $b_{i,j}=0$ otherwise. Note that $B$ is upper-triangular with ones on the diagonal, so its determinant is $1$. 
Now let $C$ be the diagonal matrix whose diagonal is $(\psi(1),\ldots,\psi(n))$.
A matrix product computation shows that 
$$
A=B^tCB\quad\mbox{hence}\quad \det A=(\det B)^2\det C=\psi(1)\cdots\psi(n).
$$
Now going back to your question.
Consider Euler's totient function $\phi$.
It is well-known that
$$
m=\sum_{k|m}\phi(k)
$$
so
$$
a_{i,j}=gcd(i,j)=\sum_{k|gcd(i,j)}\phi(k)=\sum_{k|i,k|j}\phi(k).
$$
Applying the general result above, we find:
$$
\det A=\phi(1)\phi(2)\cdots\phi(n).
$$
