Inverse problem for Sturm--Liouville operators with frozen argument on closed sets