Let $L$ be a language, and consider the following relation $\equiv_L$ on strings: $s_1 \equiv_L s_2$ if and only if, for every string $w$, we have that $s_1w \in L \Leftrightarrow s_2w \in L$. This is an equivalence relation.
Let $I(L)$ be the number of equivalence classes of $\equiv_L$
(a) Suppose $L$ is a language and $I(L)$ is finite. Construct a DFA recognizing $L$ that has exactly $I(L)$ states.
(b) Consider the language $L = \{www : w \in \{a,b\}^*\}$. Show that $L$ is not regular by giving infinitely many pairwise inequivalent elements. [which is something proven to work earlier]
Now, for (a) I think I got a reasonable solution, for (b) I don't feel so sure.
For part (a) I describe an algorithm which first creates a start state for the DFA and labels it $\bar\varepsilon$, i.e. the $\equiv_L$-equivalence class of $\varepsilon$. Second, for each letter $a$ in the input alphabet a new state $\bar a$ is created and a transition from $\bar\varepsilon$ to $\bar a$ is labelled $a$. Then all the states with the same label are merged in a single state, and the transitions are adjusted as a consequence. Hence, this procedure just carried on $\bar\varepsilon$ is iterated to each state just added. The algorithm stops when an iteration does not add any new state or transition.
Do you think that the writer wanted me to use this much information about $\equiv_L$-equivalence classes or there is a neater solution?
For part (b), I believe that all the words generated by $ab^*$ are pairwise not $\equiv_L$-equivalent, with that $L$. Am I not sure I can justify it further than this, but is there another simpler example?
Thank you for any help, this is a rather long question.