Is there any difference between equality and identity, or are they the same concept?
Different sources (contexts) may approach these concepts differently. The authors of the introductory logic text forallx uses the equality symbol (=) to stand for a two place predicate and calls it identity: (page 222)
This does not mean merely that the objects in question are in-distinguishable, or that all of the same things are true of them.Rather, it means that the objects in question are the very same object.
In a different context there is the identity of indiscernibles. Peter Forrest describes this concept:
The Identity of Indiscernibles ... is usually formulated as follows: if, for every property F, object x has F if and only if object y has F, then x is identical to y. Or in the notation of symbolic logic:
∀F(Fx ↔ Fy) → x=y.
Again an equal sign is used in the symbolization, but only a special kind of identity is defined.
Note that this definition is different from the previous one. That previous definition explicitly noted that two objects having the property that "all of the same things are true of them" does not characterize identity. Identity was being the "very same object", not two different objects with the same predicates true of them.
What this suggests is that there is not likely to be any single difference between equality and identity. Each context where these two terms are used in some way may have its own definition. Any difference would be with respect to a particular context.
If one is given a context, explicitly look for definitions of equality and identity and then compare those definitions with others that one is familiar with such as the two above.
Forrest, Peter, "The Identity of Indiscernibles", The Stanford Encyclopedia of Philosophy (Winter 2016 Edition), Edward N. Zalta (ed.), URL = https://plato.stanford.edu/archives/win2016/entries/identity-indiscernible/.
P. D. Magnus, Tim Button with additions by J. Robert Loftis remixed and revised by Aaron Thomas-Bolduc, Richard Zach, forallx Calgary Remix: An Introduction to Formal Logic, Fall 2019. http://forallx.openlogicproject.org/forallxyyc.pdf
In formal logic, identity is a two-place predicate. It could be written Identical(x,y). It has the value true when x and y are numerically identical and false otherwise. As a matter of syntactic sugar, it is usually written as x=y, but it is still a two-place predicate. In first-order logic, at least, there is no need for an additional relation of equality, so we might say they are the same.
In mathematics, an additional complication arises. Mathematicians do not typically write formulas using the strict requirements of formal logic, In particular, they typically omit the quantifiers and take them as read. As a result, it may become ambiguous as to whether universal or existential quantification is implied. So, for example, a relationship like
x↑2 - 2x - 3 = 0
is implicitly existentially quantified, i.e. it is solvable for a particular value of x. On the other hand,
sin↑2 x + cos↑2 x = 1
is implicitly universally quantified, i.e. it holds for all x.
Mathematicians usually refer to the first as an equation and the latter as an identity relation. If we chose instead to write the formulas in a more strict fashion with the quantifiers made explicit, there would be no need for the distinction.
∃x. x↑2 - 2x - 3 = 0
∀x. sin↑2 x + cos↑2 x = 1
A possible exception might arise if you were to venture into the realm of intensional logics, where you might use equality to denote extensional equivalence, and identity for intensional equivalence.