The law of identity is best understood as metalogical. If we didn't assume the law of identity, then logical laws, for example the modus ponens, (A → B) ∧ A ⊢ B, would be useless because the second A couldn't be assumed to refer to the same thing as the first A, and same thing for B. No law of identity, no deductive logic.
Without the law of identity, it would be confusing to use the same symbol more that once. Thus, the modus ponens would become (A → B) ∧ C ⊬ D, an implication which is obviously not true. A ⊢ ¬¬A would become A ⊬ ¬¬B, again not true. Even A ⊢ A ∨ B would become false: A ⊬ C ∨ B.
∘∘∘∘∘∘∘∘∘∘∘∘∘∘∘∘∘∘∘∘∘∘∘∘
It should be said that it is perfectly logical to use expressions which contradict the law of identity. An expression such as for example x ≠ x is perfectly logical, logical in the precise sense that we have no difficulty assigning a truth value to it, namely False, just as we have to say that 0 = 1 is false.
This is on a part with the fact we can assert expressions that contradict the law of contradiction. Thus, we are able to logically handle contradictions, for example A ∧ ¬A, without any difficulty, and this precisely because the law of contradiction says contradictions are false.
∘∘∘∘∘∘∘∘∘∘∘∘∘∘∘∘∘∘∘∘∘∘∘∘
Another point deserve mention. Many programmers and computer scientists will argue that the law of identity is falsified by computers. One answer here even gives an over-sophisticate example of that argument (Not a Number, NaN).
But this argument is fallacious. Computer programs are sequences of instructions, which, clearly enough, implies that they are to be understood as unfolding over time, so to speak. Thus, there is no reason to understand a variable A on line 1089 to be referring to the same thing as the variable A on line 1088. Indeed, one of the most important program statement in computing is that assignment statement which can be used in particular to increment a value, for example: A := A + 1. Obviously, A := A + 1 means that if initially A is 1, then it will be 2 once the assignment statement will have been run. Thus, the same name A will inevitably refer to two different values. However, the law of identity of course does not mean that things cannot change.
Another example is the notion of random number, which by design of the random number generator will most likely be different each time it appears in a statement. So, arguing that the law of identity does not hold because there are example of computer program variables that are not equal to themselves is a red herring. We might just as well argue that we don't bathe in the same river twice or that we ourselves are never identical to what we were just a fraction of a second ago.