I just began using a new Macbook Pro 15" Retina running Mountain Lion. After a couple of days transfering files (from my previous Macbook Pro (early 2011) running Snow Leopard) and generally setting it up the way I wanted, I started getting the following behavior: When I have a few applications open, if I switch to another application by clicking on that application's dock icon, all other application windows disappear.
After some searching, I found this discussion of a similar problem. The solution there was to select the "Show All" option in the application menu (the menu in the upper left corner just to the right of the Apple menu) for a given application. I tried that and all my application windows did indeed appear. But then the next time I clicked on a dock icon, all the other windows disappeared again and I'd have to click "Show All" again. I'm trying to figure out how to get back to "Show All" being the permanent default.
One other thing: Upon further checking, I discovered that when an application creates a second icon in the dock (for example, I currently have two Firefox and two R windows open, which has resulted in there being a second Firefox and a second R icon on the right side of my dock) only clicking on the "new" icons causes other windows to disappear. Clicking on the "original" icons just switches applications without making any other application windows disappear.
I never experienced this behavior before with my previous Macbook Pro. I'm trying to figure out why this is happening (did I accidentally change some setting?) and how to make sure it never happens again. If it would help to know more about the hardware/software configuration or settings of my Mac, please let me know what information to post.