Shaykh Muḥammad ibn Ṣāliḥ al-ʿUthaymīn [d. 1421 AH] said [concerning the issue of confusing pure and contaminated water]:
[Imām] al-Shāfiʿī said that one should seek the true state of [both waters]. This is the correct opinion and the second view in the madh`hab [of Imām Aḥmad] for his (ﷺ) saying in the ḥadīth of Ibn Masʿūd (may Allāh by pleased with him) concerning the issue of a person having doubts in his ṣalāh: ‘If one of you should have doubts in his ṣalāh then let him seek the truth concerning it, then let him build on his conclusion.’ This is a clear prophetic evidence that validates seeking the truth in matters of confusion. As for theoretical evidence, it is from among the established principles of the people of knowledge that if ever complete assuredness [in a matter] is impossible [to attain], an individual should return to what he believes to be most probable. In this matter, complete assuredness is not possible, so we should return to what we believe to be most probable, which would be to seek and inspect [both waters] in search of their respective states. This would be the course of action if there exist some signs or indications that could be used to differentiate the contaminated from the pure water. In such a state, the matter is amenable to inspection due to the presence of these clues. If there are no signs, such as if there are two vessels [of water] that are wholly similar to one another in type and colour, then how can one seek to inspect them to know their states? Some scholars say that if one’s heart can derive comfort from one of them, he should use it. They use qiyās (analogy) in this instance for someone who is ignorant of the direction of the qiblah [for example]. He searches but cannot find evidence to guide him to its direction. In this situation they say he should pray in a direction from which he derives comfort. Likewise in this matter he should use the water he feels most comfortable with. There should be no doubt that [the opinion of] him using one of the two waters in this situation holds a form of weakness. However, it is still superior to him performing tayammum.
Source: Al-Sharḥ al-Mumtiʿ: 61-62
Translated by: Riyāḍ al-Kanadī