Why isn't the "annihilator" matrix a zero matrix? I am struggling to understand why M is not null since:
$$\mathbf M=I−X(X′X){^-}^1X′=I−XX{^-}^1X'{^-}^1X′=I-I=[0] $$
What's wrong with that reasonning?
This is more a related thought than anything else, but I thought it might be useful for people looking at this question in the future. Herr K. should write a short answer and have it marked as accepted.

Let $X$ be an $n \times k$ matrix with linearly independent columns. Let $S \equiv \text{span}(X)$.

Regression can be thought of as the following problem: Given an n-dimensional vector $y \in \mathcal{R}^n$, find the vector in $\hat{y} \in S$ that is closest to $y$ -- i.e.
$$\hat{y} = \arg\min_{z \in \mathcal{R}^n} ||y - z||$$
It can be shown that the solution to this problem is given by
$$\hat{y} = Py = X (X' X)^{-1} X' y$$
where we refer to the matrix $P = X (X' X)^{-1} X'$ as the "projector matrix." Then the matrix $M = (I - P)$ allows you to get the residuals of your regression by $\hat{u} = (I - P)y = y - \hat{y}$. As you said, if $X$ is square then $P$ reduces to the identity and the residuals are 0. This is insightful for several reasons.


Geometrically, if $X$ is square and has $n$ linearly independent columns then $\text{span}(X)$ is all of $\mathcal{R}^n$. Then the projection problem reduces to picking the vector in $\hat{y} \in \mathcal{R}^n$ that is closest to some vector in $y \in \mathcal{R}^n$. Obviously, if your vector is coming from the span of the set, the minimum distance choice would be the vector itself. We see this because as you showed $P = I$ in this case. Then $M = (I - P) = 0$ which means you have 0 residuals and you have a perfect fit of your data.
Additionally, this is why empirical economists are careful about "throwing in the kitchen sink" in terms of how many variables are included. If you have as many linearly independent variables as observations then you can get a perfect match whether your exogenous variables are related to your endogenous variables or not.