In the nineteenth century gong’an xia’yi novel Sanxia wuyi 三侠五义 [Three Heros and Five Gallants], the identity of characters is not stable but rather fluid. At the same time, the fluid identity of the characters in Sanxia wuyi provides the composition of court cases with a variety of narrative possibilities, which embodies the logical thinking of gong’an novels in late imperial China. In this paper I investigate the layers of character’s fluid identity in Sanxia wuyi from the perspective of triple worlds, namely the object world, the mundane world, and the immortal world. By discussing the fluid identity and triple-world dynamics in Sanxia wuyi, I conclude that the identity continuity embodied and emphasized by the intersection of the object world and the mundane world is one of the characteristics of Sanxia wuyi as a gong’an novel. I then discuss the intersection of the immortal world and the mundane world to show how the fluid identity of Bao Zheng, the protagonist of Sanxia wuyi, affects the process of case investigation. Based on this paper, the further study of Chinese gong’an novels will be beneficial to the value interpretation of corresponding literary works, and to understand the writing logic and structure of Chinese vernacular literature in late imperial China.