We concentrate on a part of your question, the choice of $f$. Instead of pulling an answer out of a hat, we wander around systematically for a while.
Your recurrence is, I believe (edit: verified in a comment),
$$x_{n+1}=\frac{12x_n -5x_n^3}{8}.\tag{1}$$
The general Newton-Raphson recurrence is
$$x_{n+1}=x_n - \frac{f(x_n)}{f'(x_n)}.\tag{2}$$
Note that (1) can be rewritten as
$$x_{n+1}=x_n- \frac{5x_n^3-4x_n}{8}.\tag{3}$$
Comparing (2) and (3), and changing $x_n$ to $x$, and taking the reciprocal, we get
$$\frac{f'(x)}{f(x)}=\frac{8}{5x^3-4x}.$$
This is a separable differential equation, which we can solve.
Thie above in some sense answers the question of how we obtain $f(x)$ from the recurrence.
So much for generalities. Solving the DE, or by inspection, we see that
$$f(x)=\frac{5x^2-4}{x^2}=5-\frac{4}{x^2}$$
does the job.
Remark: More generally, let us solve $x^2-a=0$, using the function $f(x)=1-\frac{a}{x^2}$. Then $f'(x)=\frac{2a}{x^3}$, and the Newton-Raphson iteration is
$$x_{n+1}=x_n -\frac{1-a/x_n^2}{2a/x_n^3}=\frac{3x_n}{2}-\frac{x_n^3}{2a}.$$
The nice thing here is that division need not be part of the algorithm, for we can precompute $\frac{1}{2a}$ and just use multiplication.
By way of contrast, the usual Newton Method choice $f(x)=x^2-a$ involves division by varyign quantities. That could be significant in certain hardware limited settings.