You said yourself that the function takes two arguments. So, what happens when we give it an element of real numbers, i.e., just one number? This is a type error: one argument is not enough.

Second: do you know what is? I am not sure either. So, can you give any real numbers as inputs to f? Lastly, there are several variants to define mod when one of the arguments is negative. E.g., one option is 5 mod -3 = 2 and another is 5 mod -3 = -1. Both are reasonable because 5 - 2 and 5 - (-1) are divisible by -3; both versions have advantages and disadvantages. Check if the mod function from your textbook or lecture notes accepts negative numbers.

This cannot be because x and n - 1 are undefined. The range is a single set of outputs for all possible inputs; it may not depend on some concrete inputs.

What do you denote by two numbers in parentheses? Sometimes this denotes the greatest common divisor of the two numbers, but I don't think this is what you mean.

This is incorrect because the left-hand side is a function and the right-hand side is a number.

To evaluate g(g(g(8))), find g(8) and call it, say, u. Next find g(u) and call it v. Finally, find g(v).