How can tax residency be proven within the EU?
There is no unique way of proving residence for tax purposes. The matter boils down to who is able to prove where the person's economic activity takes place.
Citizens of the EU as well as non-residents staying for longer than 90 days in the EU have to obtain a census certificate which reflects their "habitual residence", and thus the EU country, province, and tax administration(s). That certificate may serve as primary proof of residence for tax purposes, although it might be outweighed by evidence that the certificate does not reflect the person's tax jurisdiction.
wouldn't that result that you can live in one of those countries and pay taxes to another country (One of EU Schengen countries) without any problems?
Yes, but there can certainly be problems. The tax ministry of a member of the EU will try hard to scrutinize the certificate accuracy if it suspects tax evasion.
One renown case was that of singer Montserrat Caballé, who was convicted for tax fraud by purporting to live in Andorra notwithstanding that she was living in Spain at that time.
The fact that Andorra is neither a member of the EU nor of the Schengen area is irrelevant, since Andorra and Spain have signed a treaty of cooperation and information exchange on tax matters. That is in fact one of the conditions Andorra accepted so as to be removed from EU's/Spain's list of tax havens.
Because of a ministry's interest and ability to disprove the taxpayer's allegation of habitual residence, taxpayers need to devise more thoughtful approaches to fiscal planning that do not violate the law.