My task is to show that if a language $L \subseteq \{a, b\}^*$ is recognised by a finite automaton then there exists a finite automaton that recognise all the prefixes and suffixes of the word in $L$.
$$\text{Pref}(L) = \big\{x \in \{a,b\}^* \big| xy \in L\text{ for some }y \in \{a,b\}^*\big\}$$
and
$$\text{Suff}(L) = \big\{y \in \{a,b\}^* \big| xy \in L\text{ for some }x \in \{a,b\}^*\big\}$$
I've come so far to understand that:
A word $u$ is a prefix of a word $v$ if there is a word $w$ such that $v=uw$. And intuitively I somehow believe that for a word $w$ a prefix/suffix can be all the partitions(?) in order for the word $w$, for example if the word is $abab$ then the possible prefixes/suffixes are
$$\big\{\emptyset, \{a\}, \{ab\}, \{aba\}, \{abab\}\big\}$$
However, I'm having a hard time actually proving this in a mathematical way. What I assume is that for a given finite automata, we'd have to turn all the states on a path to an accepting state into accepting states? Anyone care to help me prove these two?