Dear Student
Water, being a liquid can be easily compressed and its true that the molecules come closer to each other while they are being compressed. But we should remember that liquid have their own volume, and when it comes to compressibility of a liquid, we cannot neglect volume viscosity, i.e, the resistance of the liquid to flow and is increases with the density.
Therefore, any liquid when compressed, would become more viscous, forcing the molecules to come closer and closer, and a point will come when these molecules will find it extremely difficult to slide past one another as they were able to do when in the liquid state at the atmospheric pressure, thus they will be forced to form some sort of rigid structures.
[NOTE: Also, water is one such liquid which cannot be converted into a permanent solid at any pressure.]
Regards