First, recall the rank-nullity theorem, which says for an [tex]m\times n[/tex] matrix [tex]\mathbf A[/tex], the following holds:
[tex]\mathrm{rank}(\mathbf A)+\mathrm{null}(\mathbf A)=n[/tex]
That is, the rank and dimension of the nullspace of [tex]\mathbf A[/tex] add up to the number of columns. Note that any time [tex]\mathrm{null}(\mathbf A)>0[/tex], we have at least one vector in the nullspace of [tex]\mathbf A[/tex], which can contribute to the system [tex]\mathbf{Ax}=\mathbf b[/tex] having infinitely many solutions.
a. If [tex]n=7[/tex] and [tex]r=5[/tex], then
[tex]5+\mathrm{null}(\mathbf A)=7\implies\mathrm{null}(\mathbf A)=2[/tex]
so there would be infinitely many solutions.
b. If [tex]n=7[/tex] and [tex]r=6[/tex], we get 1 in place of 2 in part (a), so again, there would be infinitely many solutions.
c. If [tex]n=r=5[/tex], then we'd get a nullity of 0. This means that, in order for a solution to exist to [tex]\mathbf{Ax}=\mathbf b[/tex], the columns of [tex]\mathbf A[/tex] must be a linear combination of [tex]\mathbf b[/tex]. Otherwise, there would be no solution to the system.
d. If [tex]n=5[/tex] and [tex]r=4[/tex], then the nullity is 1, so there would be infinitely many solutions.
Indeed, any time [tex]n>r[/tex], the nullity would be non-zero, meaning there will always be infinitely many solutions in this case.