Question: Can a weapon wielded during combat be immediately identified as a masterwork weapon simply by looking at it, or does it require some sort of search, appraise, craft(weaponsmithing) or some other ways to see that it is in fact a masterwork weapon ?

Answer: 
I think weapons can have various visible qualities that rule out the possibility of them being considered masterwork: notches in the blade, bends where things should be straight, and so on. As a DM, I would probably use signs of poor maintenance, like rust, as a sign of low quality weapons—after all, even though you *can* fail to give a quality weapon proper maintenance, that’s not expected in this game where equipment maintenance is hand-waved as assumed to be happening in the background.

But plenty of other things can be wrong with a weapon that aren’t obvious just by seeing the weapon at a distance. Issues with balance and weighting, for example. Maybe portions of it haven’t been hardened properly. Whatever. It seems easily plausible that a weapon could fail to live up to the standards of “masterwork,” without actually having any visible defects.

And then, on the flip side, there are certain things in the rules that are always applied solely to masterwork weapons. Most special materials, for example, specify that weapons made from that material are always masterwork. If the material can be recognized, then you can tell it’s masterwork. Likewise, certain distinctive styles might be renowned as always of the highest quality—for example, officially katanas are statted as “bastard swords that are always masterwork.” So if you see a katana, you knew it was masterwork. Similar things might be true in a given campaign world for elven or dwarven or whatever weaponry, perhaps.

Finally, of course, magic weapons are always masterwork. Someone with *detect magic* or similar could therefore recognize masterwork weapons when they are also magical.

So the long and short of it is that there are some weapons that are clearly not masterwork, and other weapons that clearly are masterwork, and then a decent chunk of weapons that cannot be directly determined by visual inspection.

The other thing worth pointing out here is that D&D 3.5e has really minimal rules for “sizing up” your opponents, at least in martial endeavors. There is no martial analogue to Spellcraft, for example. Many tables play this straight, forcing players to learn about their opponents by making rolls and seeing what is good enough and what is not, for example, to gauge their AC. If the DM rolls opponent rolls openly, attack roll and saving throw bonuses can also be found this way. The problem with this is that you only get to see so many rolls before the fight is decided: it is rare for a fight to go more than 2-3 rounds without a clear victor having emerged (even if mopping up is often necessary). Too much happens on a given turn, in a given round, for this method to really be all that effective.

It’s also not realistic. Warriors are much better at sizing opponents up—at least in the sense of, “better than me,” “worse than me,” “about equal,” “*much* better than me,” and so on. Obviously, the real world doesn’t boil everything down to nice, neat numbers, but “getting the measure” of your opponent is a thing—that phrase, along with “sizing someone up,” is a phrase because it describes a real process.

So a warrior might not be able to tell how high-quality a weapon is at a glance, but he *will* be able to tell, very quickly, to a general degree how high-quality his opponent is. That gives hints about the quality of his equipment. An opponent *might* have been caught off-guard, and be using whatever weapon he had at hand, or somehow have recently lost his best equipment for some reason, but *most* of the time, a high-quality opponent is likely to have high-quality gear. After all, a masterwork weapon is easily affordable by 2nd level, even on NPC wealth, and well worth it for anyone who plans on hitting anyone with a weapon. Really only 1st-level characters should have non-masterwork weapons—and even most of those will still have the masterwork version.
As part of the Appraise skill description in Rules of the game, it is true that rare items are made by craft with appropriate skills between +10 and +14 and it is also true that the masterwork component of a weapon is DC20 thus a skill modifier of +10 on a take 10 required for the crafter. But the Appraise skill is used to determine the value of an item not its nature. ie. a longsword that is worth 315 gp maybe a masterwork longsword or a ceremonial longsword (used as a normal longsword in combat). If we consider this, we could even adjudicate that someone with an appraise skill could not determine if it is a masterwork item but only that it is worth that much. A rusted/damaged masterwork longsword could be valued at 200 gp instead of the 315gp with an appraise check. On the other hand, someone with a craft skill in the appropriate craft has to recognize something he can do. The crafter would know it's a masterwork weapon, that it is damaged but won't be able to give a value of the item.

Also, it is not clear if appraise can be used on items at all as weapons are defined as weapons and armors as armors in rule books while items are all other objects.

When looking into the Player's Handbook, Dungeon Master's Book and Rules Compendium, there is no rule that states how to recognize a weapon, an exotic weapon or a masterwork weapon. The only rule that exists is for magic weapons that can't be determined unless with something similar to detect magic. 
The question is very valid but I can't see anything in the rules that would stop a character to recognize a masterwork item, the same as to recognize an exotic weapon, etc. At this point I would recommend leaving this to the DM to decide and take into consideration that a character with the weapon proficiency should know how to recognize a weapon he can wield and probably a masterwork version by handling it or by seeing someone handling it. And someone with the craft skill modifier of +10 should also be able to recognize a masterwork weapon. You can easily use the DM option of using skills with different modifiers such as a spot check with Int modifier that needs to beat the craft DC. But this is really an example. As long as it is not used to unbalance the game that you decide it is not possible to know or that the PC know automatically. (i. e. if they can't know, then the Sunder combat option for the PC is less interesting since it means they will potentially break and render worthless their loot. On the other hand, you may discover that always knowing and having your barbarians PC take Improved Sunder and Power Attack to break all weapons that are not masterwork will get too much gp value with the masterwork weapons collected to the groul, then you can easily add the "damaged weapon lesser value" that appraise will be used to figure out... or not let them know).

Good question, not sure the answer is what you were looking for but ultimately, it's yours and your players' game.