Rabbi J.D. Bleich has written an article on this issue titled "The Problem of Identity in Rashi, Rambam, and the Tosafists," available here.
Mark Steiner mentions this issue in passing in his article "Rabbi Israel Salanter as a Jewish Philosopher," available here:
For a simple example, consider the ancient Greek debate about
change and becoming. Opinions on the subject ranged from that of
Heraclitus, who held that one cannot step into the same river twice
(because new waters are always flowing upon you), to Parmenides who
held that change is an illusion even in the case of a river. The question
crucially depends upon the concept of identity through time—whether
we can think of a river as “the same,” as persisting through time, even
though the waters coursing through it may be “different.”
Now the Talmud asked almost the very same question, though camouflaging it in legal terminology: if one worships (prostrates himself
before) a spring, are the waters of that spring made unfit to be offered as
a libation? “Is it the water before him that he worshipped, which is no
longer there, or is it the [entire] stream of water that he worshipped?”
(Avodah Zarah, 48b). The question is not simply one of the idolater’s
intention, since there is no way to determine that. Rather the question is
philosophical, whether or not the spring itself is an object which persists
through time, and therefore could be the object of worship. We have
here the beginning of an ontological discussion, despite the ostensible
hostility of the Talmud to “philosophy” or “Greek wisdom.”
Questions of identity permeate the halakhic literature. The Rabbis
had to decide when and whether two idols are the same deity; and at
what point a sandal, undergoing alterations, becomes a different
sandal. Identity questions can decide even questions of kashrut.
Note 12 reads:
The priestly portion of dough, hallah, can (outside the Land of Israel) be
separated retroactively: after the dough is baked into bread and eaten, what
is left over is made hallah, retroactively permitting the non-priest to have
eaten the rest of the bread in the first place. (For a non-priest to eat the
priest’s portion is a serious violation.) But since, in retrospect, the bread that
was baked contained the priestly portion, why do not the standard rules of
kashrut dictate that the bread is made unkosher, just as if it had been baked
while touching a forbidden substance? On examination, the question turns
on subtle issues of identity: are the flavor particles which allegedly contaminate this bread truly one with the hallah retroactively separated? It turns out
that this is a dispute between the Taz and his father-in-law, the Bah: the Taz
in fact says that in any case of retroactive hallah separation, the rest of the
dough must be more than sixty times the volume of hallah separated. See
Taz, note 15 to Yoreh De‘ah 325.
The Maharal (Gur Aryeh, Shemos 30:29) also discusses this issue with regard to the mishkan:
ואתה אל תאמר כאשר היה המשכן בבנינו, שכל חשיבתו לא היה רק הקרשים
והדברים השייכים לו, שהרי כל אלו דברים הגיע להם שנוי, שכאשר הגיע הפסד
ליריעות וקרשים, היום בזה ולמחר באחר, עד שהיה חדש הכל, אל תאמר שהיה זה
נקרא משכן חדש, שאין הדבר כך, כי אין חשיבות המשכן הדברים החומרים, רק
עצם הציור שהיה מסודר מן השם יתברך, ואל דבר זה לא הגיע בטול ושינוי.
ובשביל זה לא נאמר שהיה שינוי למשכן, [ד]כל זמן שעצם הציור קיים אין
להקפיד על שינוי הגופות. ולפיכך יש לנו לומר גם כן שיש קיום לכל אלו
הדברים שאמרנו, שכמו בעת עשיית המשכן היה מחייב סדר המציאות שיהיו
נמצאים, כך חייב עתה הכלים אשר מיוחדים לעלוי מעלתם, ואין הפסד בהם, ואם
הגיע הפסד - לא הגיע רק מצד הנושא, כמו שאמרנו. ומפני מעלת ומדריגת השמן,
נעשה בשמן המשחה כמה נסים, כמו שמבואר במקומו. ומכל מקום התבאר לך כי
הנרות יאירו אל מול פני המנורה לעולם, כי לא הוסר אור עריכתם מן המציאות,
ודי בזה למבינים, כי הם דברים ברורים מאד: