The preposition 同 (tóng) means "same" and is used to indicate identity or similarity. In the phrase 同一个东西, it means "the same thing." It is more formal than 一样 and commonly appears in written Chinese and set phrases.
我们住在同一栋楼里。
Wǒmen zhù zài tóng yí dòng lóu lǐ.
We live in the same building.
他们来自同一个城市,很快就成了朋友。
Tāmen láizì tóng yí gè chéngshì, hěn kuài jiù chéng le péngyou.
They are from the same city and quickly became friends.
这两件事不能同日而语。
Zhè liǎng jiàn shì bù néng tóng rì ér yǔ.
These two things cannot be mentioned in the same breath.