This is true as it is nothing but the definition of My Hill Nerode Theorem.
Few definitions are below for your reference.
Definition 1. Let Σ be an alphabet and ~ a relation of equivalency on Σ*. Then relation ~ is right invariant if for all u, v, w ∈ Σ*:
u ~ v <=> uw ~ vw
Definition 2. Let L be a language (not neccessarily regular) over Σ. We define relation ~Lcalled prefix equivalence on Σ* as follows:
u ~L v <=> ∀w ∈ Σ*: uw ∈ L <=> vw ∈ L
You can further read it here
http://radek.io/2011/10/24/myhill-nerode-theorem-in-practice/