How does virtual memory work when it need to save data in physical memory into disk?
There are a few options:

if a page is in memory then it cannot be on disk as well, As such there is no duplication and the issue doesn't exist.

there is more than just the MMU's pagetable to hold paging information. This mean that the kernel has an auxiliary data structure that says where the page is on disk and the MMU page table only tracks what is in memory. This solution allows memory mapping of files whether they are on disk or over the network.