If a Ptime function loses x bits of data at every call, is it a one way function?
A one-way function is a function which is easy to compute but hard to invert. More accurate, it is a polytime function $f$ such that given a random $y$, it is hard to find a preimage $x$ satisfying $f(x) = y$. The exact sense of hardness isn't important here.

Your function is not one-way since it fails the first requirement: it is not easy to compute. If you use your recursive definition, computing $f(x)$ takes $x$ applications of the function $g$, which is exponential time.

It also fails the second requirement, since its range is finite. You can hardcode one preimage for each possible value in the image, and so invert the function efficiently.