TITLE: Is there any monoid in which the product of two non-invertible elements could be invertible?
QUESTION [9 upvotes]: I think the title speaks for itself. Thus I just explain the story behind the question. Of course, you may want to skip the story.
Story: Currently, I teach a course in linear algebra and matrices with a mathematician colleague of mine. In preparing for the class, we discussed together about one of the standard theorems of matrices saying the product of two invertible matrices is invertible. To understand the theorem and its converse, I naturally came to the question asked in the title. To my surprise, neither the colleague I discussed with, nor four other mathematician colleagues of mine could come up with an answer. But the question seems very natural and it is very surprising if it has been remained unnoticed. That is why I came to MO to find the answer.  
PS. None of the colleagues I asked the question is an expert in algebra, and I am a mathematics educator. 
PPS. You may replace "monoid" with whatever you wish, providing that you keep the rest of the title intact! Please keep your example natural (if there is one)!

REPLY [5 votes]: Since the question came from an undergraduate level perspective, here's a slight variant on the answers given thus far that students might appreciate.
Take the vector space P of real polynomials.  There are two operators on P, D=differentiation and I=integration (to make integration a linear operator, we "set c=0"). Now DI is the identity map, but I is not onto (as the constant polynomials are not in its image) and D is not injective (as D(c) = 0 for any constant polynomial c).