The Insignia that NCOs and Officers use on modern military dress (post WW1) look to be extremely small in comparison to say a Centurions Crested helmet. Combine this with mud, sand, dust on a battlefield, how did soldiers identify who a superior officer was given I'm assuming their identifying symbols would be covered.
Adding on, how did snipers know who to shoot since they would be so far it would be extremely difficult to see the insignia.
They'd know who their officers were from training. Unlike soldiers in the ancient or medieval world, modern soldiers have been trained from the start within the same formation that they would fight in, alongside the same rank and file and with the same officers and NCOs over them. Any changes in the leadership could hardly go unnoticed by the men, and if an officer failed to get to know his men, he wasn't doing his job. British officers for one have always had a paternalistic duty to their men, and this has been reflected in most other armies. In broadly meritocratic modern militaries, it simply wouldn't be possible for an officer to rise to a position of leadership at the same time as his men didn't know who he was.
Of course there would have been a certain amount of persistence in ancient and medieval military formations, but nothing approaching the cohesion of a modern unit. It would be a grave situation indeed where men would end up in combat under officers they had never interacted with before; and where this did happen (the most obvious example is in the Red Army from 1941-5) we see a predictable drop in unit cohesion and morale and high rates of desertion.
If a situation demanded cooperation with other units with unfamiliar officers, the relatively discreet indications of rank would suffice. And, of course, any good officer wouldn't be waiting for his men to prompt him before giving them very clear orders. For the rank and file, it wouldn't have been a matter of working out who the officers were; more a matter of hearing an order, perhaps making sure that the source of the order is an officer, and then getting on with the job. Even in the confusion of battle any well-trained troops would have been familiar enough with their officers to recognise them and follow their orders without any difficulty.
As for the snipers--if officers stopped wearing any indications of rank, they didn't know who to shoot. They had to rely on more subtle indications, observing who was using binoculars, who was giving orders, perhaps judging age, because the most important officers could be ten or twenty years older than their men. That said, certainly up until the end of WWII few armies had their officers dress exactly the way their soldiers did. Officers were still distinctive enough to allow snipers to be effective.