I always got taught that if the determinant of a matrix is $0$ then the matrix isn't invertible, but why is that?
My flawed attempt at understanding things:
This approaches the subject from a geometric point of view. Take two $2\text x2$ matrices, by definition $A$ has an inverse if there exists a matrix $B$ such that $AB=I$, here $B$ will be denoted as $A^{-1}$.
From my understanding, a determinant of $0$ means that the space will be "compressed" to a one dimensional line or point. Taking an arbitrary matrix $A$, if we apply any linear transformation to it and get a point, we won't be able to get back to $I$ in $2$ dimensions regardless of the linear transformation we apply as we have a point and we can't really stretch it and play around with it like a vector.
Why I realized my attempt is flawed:
While writing this I remembered how linear transformations from one dimension to another exist so it wouldn't make much sense to say we can't get back to $I$ in two dimension once we have a vector in one dimension (still can't really understand the flaw if we get a point instead of a vector).
Can anyone correct my approach and/or provide an algebraic one as well?
You're almost there: the inverse transformation is one-to-many, since there are infinitely many points which project to the same point in the original transformation. This means the columns of the matrix are not linearly independent (as $\hat{i}$ and $\hat{j}$ both lie on the 1D line), so the matrix is not invertible.