In the accepted solution of the question If L is regular, prove that $\sqrt{L}=\{w:ww\in L\}$ is regular the answerer made the claim that "What's left is to show that $δ ′ (q_{0}' ,w)=h$ , which can be done via induction on the length of w". Unfortunately, I seem to be running into trouble with this induction. I was hoping to get some clarification about what I'm doing wrong.
In the solution provided the DFA that recognizes $L$ is $\mathcal{A}=\{Q,\Sigma,\delta,q_{0},F\}$ and we construct a new DFA $\mathcal{A}'=\{Q',\Sigma,\delta',q_{0}',F'\}$ where
$Q'=\{\text{functions}\,\,f:Q\to Q\}$,
$\delta'(f,a)=g$ where $g(q)=\delta(q,a)$,
$q_{0}'$ is the identity,
and $F'=\{f:f^{2}(q_{0})=f(f(q_{0}))\in F\}$.
We also define $h(q)=\hat{\delta}(q,w)$. I do manage to get the case of the empty word for the induction. However, in the inductive step I get (where $w\in\Sigma^{*}$ and $a\in\Sigma$):
$$\hat{\delta'}(q_{0}',wa)=\delta'(\hat{\delta'}(q_{0}',w),a)=\delta'(h_{1},a)=g$$
where $h_{1}(q)=\hat{\delta}(q,w)$ by the inductive hypothesis. The above function $g$ is defined as:
$$g(q)=h_{1}(\delta(q,a))=\hat{\delta}(\delta(q,a),w)=\hat{\delta}(q,aw)$$
which is not what I wanted. I am certain that I am making a silly error. If someone could point it out to me I would be grateful. Thank you for your help.