"I have been informed that the Malaysian Immigration Department does not allow me and my family to go abroad. I respect these instructions and will stay in the country together with the family," he said on Facebook.
Razak lost office after a snap election saw his National Front (BN) party defeated in parliament by an opposition coalition of former Prime Minister Mahathir Mohamad, who was sworn in on Friday.
"We did our best but I admit there was some imperfection, but our priority has always been to ensure the security and prosperity of Malaysians," Razak was quoted as saying by The Star newspaper.
The opposition coalition is led by former Prime Minister Mahathir Mohamad, who headed the government between 1981 and 2003. At 92, he is set to become the world's oldest prime minister.