Let \(A \in \mathbb{F}^{m \times n}\) where \(\mathbb{F}\) is a field.
Recall that the rank of \(A\) is given by the dimension of
the column space (or row space) of \(A\).
The nullity of \(A\), denoted by \(\operatorname{nulllity}(A)\),
is the dimension of the nullspace of \(A\).

Then \[\operatorname{rank}(A) + \operatorname{nullity}(A) = n.\]

We now give a proof of this result.
Recall that elementary row operations do not affect the row space and
the nullspace of \(A\). Let \(R\) be a matrix in reduced row-echelon
form obtained from \(A\) via elementary row operations.
Then, \(\operatorname{rank}(A) = \operatorname{rank}(R)\)
and \(\operatorname{nullity}(A) = \operatorname{nullity}(R)\).

Note that the dimension of the row space of \(R\), call it \(k\),
is equal to the number of leading 1's (i.e. pivots) and the dimension of
the nullspace of \(R\) is given by the number of columns of \(R\)
minus the number of pivots.
Hence, \[\operatorname{rank}(R) + \operatorname{nullity}(R) = k+ (n-k)=n.\]
The result now follows.

Row-reducing the given matrix to RREF gives
\(\begin{bmatrix} 1 & 0 & -2 \\ 0 & 1 & 1 \\ 0 & 0 & 0 \end{bmatrix}.\)
Since there are two pivots, the rank of the given matrix is $2.$

Can the nullity of a \(4 \times 5\) matrix with real entries be 0?

No.
The rank of a \(4\times 5\) matrix is equal to the dimension of the
column space. Since the column space of such a matrix
is a subspace of \(\mathbb{R}^4\), the dimension of the column space
is at most 4. Hence, by the rank-nullity theorem,
the nullity is at least \(5\) minus the rank and therefore is at least 1.

Let \(R\) be a matrix in RREF. Prove that the nullity of \(R\) is given
by the number of non-pivot columns.

Note that the rank of \(R\) is given by the number of pivot columns.
As the number of columns of \(R\) is given by
the sum of the number of pivot columns and the number of non-pivot columns,
by the rank-nullity theorem,
the nullity of \(R\) is equal to the number of non-pivot columns.