I am familiar with the rank theorems, but I can't seem to figure this one out.
I want to prove this using the linear maps.
Let $f: \mathbb{R}^n \to \mathbb{R}^n$ be the linear map associated with $A$. And let $V = \{ v_1, ..., v_k \}$, $V \subset \mathbb{R}^n$, be a basis for $A$, with $k \leq n$ and nul($A$) = $n-k$.
How do I proceed?
We define $T(V) = \{T(v): v \in V\}$. Note that when $V$ is a vector space and $T$ is a linear map $T:V \to W$, $T(V)$ is a subspace of $W$ which is called the image of $V$. By definition, the rank of a map $T:V \to W$ is $\dim(T(V))$ (which coincides with the rank of the associated matrix).
Now, note that $f^2(V) = f[f(V)]$. Since $f(V) \subset V$, it follows that $f[f(V)] \subset f(V)$ (this is the trickiest bit here; see if you can make sense of it). It follows that $\dim(f[f(V)]) \leq \dim(f(V))$. That is, the rank of $f^2$ is at most equal to the rank of $f$, as desired.