Starting with an effective coding of the lists of numbers, I recently proved that concatenation of lists is primitive recursive. On the way I used that if a function is primitive recursive, then its history is primitive recursive. Proving the last result, I used the explicit formula for my effective coding.
Given an effective coding, does the history function preserve primitive recursiveness?
By an effective coding, I mean a bijective coding whose decoding functions are primitive recursive.
EDIT: Given a coding $k$ and a function $f:\mathbb N^{r+1}\to\mathbb N$, by the history of $f$ I mean $H_f(\overline x,y)=k(<f(\overline x,0),f(\overline x,1),\dots,f(\overline x,y)>)$
EDIT 2: Hoping to draw attention to this interesting question I hereby give an example coding, whose history function preserves primitive recursiveness.
Assume $P,L,R$ is a surjective primitive recursive coding triplet for the pairs of numbers. Define $P_k:\mathbb N^{k}\to\mathbb N$ by $$P_1(x_1)=x_1$$ $$P_{k+1}(x_1,\dots,x_k,x_{k+1})=P(P_{k}(x_1,\dots,x_k,x_{k}),x_{k+1})$$
Denote the decoding functions of $P_k$ by $J^k_i\quad i=\overline {0,k-1}$
Define $t:\mathbb N^{*}\setminus\{\varepsilon\}\to\mathbb N$ by $$t(<x_0,\dots,x_m>)=P(m,P_{m+1}(x_0,\dots,x_m))$$
$\varepsilon$ here is the empty list and $t$ is an effective coding of the non-empty lists.
Now if $f$ was primitive recursive and $$F(\overline x,y,z)=P(y+1,P(R(z),f(\overline x,y+1)))$$
then $$H_f(\overline x,0)=t(<f(\overline x,0)>)=P(0,f(\overline x,0))$$ $$H_f(\overline x,y+1)=F(\overline x,y,H_f(\overline x,y))$$
Therefore, $H_f$ is primitive recursive. Conversely $f(\overline x,y)=mem(H_f(\overline x,y),y)$. q.e.d.
I'm not sure I understand your question correctly, but if $f$ is primitive recursive, then $H_f$ will likewise be primitive recursive: $$ \begin{align} H_f(\vec x, 0) =& \langle f(\vec x,0) \rangle \\ H_f(\vec x, y+1) =& H_f(\vec x,y) * \langle f(\vec x,y+1) \rangle \end{align}$$ where $\langle\cdots\rangle$ is the function that encodes a singleton list (which must surely be primitive recursive if the encoding is to be "effective"), and $*$ is concatenation of lists (which you've just proved is primitive recursive).
Conversely, if $H_f$ is primitive recursive, then $f$ is too, since it can be recovered simply by composition of $H_f$ with a decoding functions.
Likewise $H_f$ is total recursive iff $f$ is. But if $f$ is only partial recursive then the definition of $H_f$ doesn't even seem to be meanigful in general.