All functions have domains and ranges. Functions are items to which you give them a value and they give you a value (usually these are numbers).
For example, all of the following are functions, and as such they have domains and ranges (which are also given, based on the typical real number analysis concepts):
f(x) = x (D = all real numbers, R = all real numbers)
f(x) = x+3 (D = all real numbers, R = all real numbers)
f(x) = 5x (D = all real numbers, R = all real numbers)
f(x) = 1/x (D = all real numbers except x=0, R = all real numbers except 0)
f(x) = x^2 (D = all real numbers, R = all non-negative real numbers)
f(x) = sqrt(x) (D = all non-negative real numbers, R = all non-negative real numbers)
f(x) = e^x (D = all real numbers, R = all positive real numbers)
f(x) = log(x) (D = all positive real numbers, R = all real numbers)
f(x) = sin(x) (D = all real numbers, R = the inclusive interval from -1 to 1)
f(x) = cos(x) (D = all real numbers, R = the inclusive interval from -1 to 1)
f(x) = tan(x) (D = all real numbers except those of the form n*pi/2 for n being an integer, R = all real numbers)
f(x) = arcsin(x) (D = the inclusive interval from -1 to 1, R = the inclusive interval from -pi/2 to pi/2)
f(x) = arccos(x) (D = the inclusive interval from -1 to 1, R = the inclusive interval from 0 to pi)
Only functions have domains and ranges because that's where their concepts make sense. For example, the domain of f(x) = x^2 is all the real numbers and the range is all the non-negative real numbers. That means that I can feed this function a real number (like, for example, 3) and it will spit out a non-negative real number (in this case, 3^2 = 9). I can't expect to get -3 out from this function no matter what I give it.
If I were talking about the function f(x) = arcsin(x), then the domain is the inclusive interval from -1 to 1 and the range is the inclusive interval from -pi/2 to pi/2. This means that I can feed it only a value between -1 and 1 (inclusive), like 0.5, and it will give me a response somewhere between -pi/2 and pi/2, in this case, pi/6.