You need here the distinction between a thing and its name(s) or representation(s).
When someone says or writes "Mozart = Mozart," the two sound tokens or ink tokens are indeed subtly different. And even if somehow they were not, they would still be different in that one spoken "Mozart" precedes the other in time and one written "Mozart" is to the Southwest of the other.
But the law of identity is not supposed to be about these name tokens, but about what they refer to. That referent, the entity being named by each of these tokens, is exactly the same: the man Wolfgang Amadeus Mozart.
That it's the referents, rather than the names one has in mind here is more easily appreciated by considering an "equation" with different signs on each side. Thus consider:
Wolfgang Amadeus = Mozart
Someone asserting this equation is not making the grotesque error of equating the two sound or ink tokens. Rather, she's claiming that these tokens refer to the very same thing.