Domain, codomain, and range This question isn't typically associated with the level of math that I'm about to talk about, but I'm asking it because I'm also doing a separate math class where these terms are relevant. I just want to make sure I understand them because I think I may end up getting answers wrong when I'm over thinking things.
In my first level calculus class, we're now talking about critical values and monotonic functions. In one example, the prof showed us how to find the critical values of a function $$f(x)=\frac{x^2}{x-1}$$ He said we have to find the values where $f' (x)=0$ and where $f'(x)$ is undefined.$$f'(x)=\frac{x^2-2x}{(x-1)^2}$$
Clearly, $f'(x)$ is undefined at $x=1$, but he says that $x=1$ is not in the domain of $f(x)$, so therefore $x=1$ is not a critical value. Here's where my question comes in:
Isn't the "domain" of $f(x)$ $\mathbb{R}$, or $(-\infty,\infty)$? If my understanding of Domain, Codomain, and Range is correct, then wouldn't it be the "range" that excludes $x=1$?

$x=1$ is not in the domain because when $x=1$, $f(x)$ is undefined. And by definition, strictly speaking, a function defined on a domain $X$ maps every element in the domain to one and only element in the codomain.
The domain and codomain of a function depend upon the set on which $f$ is defined and the set to which elements of the domain are being mapped; both are usually made explicit by including the notation $f: X \to Y$, e.g. along with defining $f(x)$ for $x\in X$. 
$X$ is then taken to be the domain of $f$, and $Y$ the codomain of $f$, though you'll find that some people interchange the terms "codomain" and "range". So "range" is a bit ambiguous, depending on the text used and how it is defined, because "range" is sometimes defined to be the set of all values $y$ such that there is some $x \in X$ for which it is true that $f(x) = y$, i.e. $f[X]$. 
One way to circumvent any ambiguity related to use of "range" to refer to $f[X]$ is to note that many prefer to define $f[X]$ to be the  "image" of $X$ under $f$, often denoted by $\text{Im}f(x)$, with the understanding that $f[X] = \text{Im}f(x) \subseteq Y.\;\; f[X]=\text{Im}f(x) = Y$ when $f$ is onto $Y$.
