There’s a word in the Pali language, anatta (there’s a special character over the last ‘a’ that I don’t know how to make on my keyboard*), which describes a central tenet of Buddhist doctrine. This tenet is the non-existence of the ego, and can best be understood as the belief that your entire existence as a cohesive self is only an illusion. In other words, that star trek teleporter discontinuity you mention doesn’t just happen when you go to sleep and wake up, in happens in between every single synaptic action potential you ever experience. Not only are you not the same person as when you went to bed last night, you’re not even the same person as you were when you started reading this.
-Will Northup (https://www.quora.com/Am-I-the-same-person-when-I-wake-up-in-the-morning)