Let $A$ be a DFA and $q$ a particular state of $A$, such that $\delta(q, a) = q$ for all input symbols $a$. Show by induction on the length of input that for all strings $w$, $\delta^* (q, w) = q$.
I'm completely new to the subject. But this is what I have done. Can someone please tell me if this is the correct solution?
For the basis of the induction $|w|=1$, $\delta (q,a)=a$ is already correct by definition.
Let $n = |w|$, the number of symbols in the string $w$. Let $\delta^*(q,w)=q$ be true for some $n \gt 1$ (hypothesis of induction). Now I should prove it for $n+1$ using the hypothesis of induction. Let $z=wa$.
$$ \delta^*(q,z) = \delta^*(q,wa) $$
It follows that: $$ \delta^*(q,wa) = \delta^*(\delta^*(q,w),a) $$
From the hypothesis, I know that $\delta^*(q,w)=q$, so if I substitute this in the above equation:
$$ \delta^*(q,a) $$
and this is equal to $q$ according to the base case. So, I conclude that $\delta^*(q,w)=q$ is true for every $n$.
Is the above so-called "solution" correct?