For an equation y = f(x), the domain is the set of all numbers that x can have. The range is the set of numbers that y can take on. Put another way, the domain is the set of all numbers that the independent variable(s) can be, the range is the
set of values that the dependent variable can be.
An example of a function whose domain consists only of real numbers would be y = cos(x). Here, x can take on any real value, so its domain is the set of all real numbers, but the range, those values that y can take on, is limited to all real numbers from
-1 thru +1; that is -1 <= y <= +1.
Real numbers include rational numbers, that is any number which can be expressed as a ratio of two integers, A/B, and irrational numbers which cannot be completely defined in that way, such as pi. But there is another set of numbers which is not within
the set of real numbers. Numbers in this set are called complex numbers, and are of the form a + ib, where a and b are real numbers, but i = sqrt(-1). 'i' is an artifice; the sqrt(-1) doesn't exist in real life, but represents a concept that is very useful
in engineering and physics problems.
There are some functions whose domains are complex because certain range values cannot be reached with only a real number domain. You will likely first come across complex numbers in class via the standard quadratic equation, y = ax^2 + bx + c. Depending
on the values of a, b, and c, x and y can be real or must be complex. Here is an example of this function whose range and domain include the set of complex numbers as well as real:
Suppose y = 0 = x^2 + 2x + 10. This has no real number solution for x that will make the equation value zero. However, if x and y are complex, then the solutions are x = -1 + 3i and -1 - 3i.
Complex numbers are usually shown graphically with the x-axis representing a and the y-axis representing b for a complex number a + bi.
I'm not sure what your third question is, but this is an example of the domain being complex. It shows that functions can be contrived such that the range can still be real, but normally, if the domain is complex, the range will be as well. I hope this