I have a matrix:
$$A = \begin{pmatrix} 1 & 1 & 1 & \cdots & 1\\ 0 & 1 & 1 & \cdots & 1\\ 0 & 0 & 1 & \cdots & 1\\ \vdots & \vdots & \vdots & \ddots & \vdots\\ 0 & 0 & 0 & \cdots & 1 \end{pmatrix}$$
I need to find $A^{-1}$. How could I do that, knowing that matrix A has size $n \times n$?
HINT: Consider the matrix
$$B = \begin{pmatrix} 1 & -1 & 0 &\cdots & 0\\ 0 & 1 & -1 & \cdots & 0\\ 0 & 0 & 1 & \ddots&0\\ \vdots & \vdots & \ddots & \ddots & -1\\ 0 & 0 & 0 & \cdots &1 \end{pmatrix}$$
One easily verifies that $$AB = I_n$$ and $$BA = I_n$$
Thus $B=A^{-1}$
Edit: How to come up with $B$? First of all you should compute some inverse matrices, maybe for the cases $n = 2$ and $n=3$. In order you may see a pattern and get an idea how a candidate $B$ for an inverse of $A$ should look like. Just verify $BA = I_n$ and $AB = I_n$ and you will end up with $A^{-1} = B$.