Given: $A + A^2 = I$.
You set out to prove $A$ is invertible by proving there is an $A'$, such that $AA' = I$.
You recognized that $A + A^2 = AI + A^2 = A(I +A) = I.$
So you got to this stage: $A(I + A) = I$. Now you let $A^{\prime} = I + A$, and from that you got $AA' = I$, where $A^{\prime}$ is the right inverse of $A$.
Note that, because addition of matrices is commutative, $A+A^2 = A^2 + A = (A+I)A = = (I + A)A=I.$ So by the same strategy we used to show that $(I + A)$ is a right inverse of $A$, it follows that $(I+A)$ is also a left inverse of $A$, and hence is THE unique inverse of $A.$
In general, and as you may already know:
For any square matrix $M$, if $M$ has a right inverse, then the right-inverse is the unique inverse of $M$, and so it is also a left inverse of $M$ (and vice versa).
So you did indeed find the inverse of $A$, in having found a right inverse of $A$, namely $A^{\prime} = I + A = A^{-1}$.
Therefore, since $A$ has an inverse, $A$ is invertible.
An alternate strategy is to take the determinant of each side of the equation:
$A + A^2 = I.$
Note that $1 = \det{(I)} = \det{(A + A^2)} = \det{(A(I + A))} = \det{(A)}\det{(I + A)} > 0.$ So $\det{(A)}$ cannot be zero. Thus, $A$ is invertible.
What might be confusing you is that you are proving IF $A + A^2 = I$, THEN $A$ is invertible, but that is NOT to say that if $A$ is invertible, then it is always the case $A + A^2 = I$.
So you shouldn't expect to find that $A+A^2 = I$ for all invertible matrices $A$, and don't worry if an example of an invertible matrix $A$ for which $A+A^2 = I$ doesn't immediately come to mind.