ITA's Matrix thing is the best power tool for airline routing research. The way you detect codeshares is when you see, say, a United and Lufthansa flight with the exact same itinerary between the exact same airports. It's usually pretty obvious when you use their visual time view.
The real trickery these days, with codeshares, seems to be whether or not you get 100% of the elite qualifying miles. For example, there are two daily flights from Houston to Frankfurt: one on a United 767 and another on a Lufthansa A380. The latter can be purchased from United, but last I checked you got zero EQMs when doing it. So fine, I flew the 767 instead, but it's one of those things that's not entirely obvious until you're booking your flight and looking at the fine print.