Reference for checking primitive recursiveness There is a theorem that states a function $f$ can be computed with a Turing-machine in time $O(g)$ with primitive recursive $g$ (of the length of input) iff $f$ is primitive recursive.

Where can I find a reference for this theorem? Wikipedia seems to state it but gives no references, nor does my books.
This is known as a Ritchie-Cobham property, or a honesty property of primitive-recursive functions.  See for instance Theorem VIII.8.8, page 297 in P.G. Odifreddi, Classical Recursion Theory, vol. 2, 1999.

Odifreddi refers to


Kleene, General recursive functions of natural numbers, Math. Ann. 112:727--742, 1936,
Cobham, The intrinsic computational difficulty of functions, Log. Meth. Phil. Sci. 2:24--20, 1964,
Meyer, Depth of nesting and the Grzegorczyk hierarchy, Not. Am. Math. Soc. 12, 1965.