Equality of functions How a function which is not defined for some value can be equal to a function which is defined for the same value? How is $f(x) = \frac{(x-2)(x-3)}{(x-2)(x-4)}$ equal to $g(x) = \frac{(x-3)}{(x-4)}$ when their domains are different?
 A: They are not. You can only say they assume the same values in the intersection of their domains, that is: $$f|_{D(f) \cap D(g)} = g|_{D(f) \cap D(g)}.$$

This answer assumes the definition: two functions $f:A \to B$ and $g:C \to D$ are equal if: $A = C$, $B = D$ and $f(x) = g(x)$ for all $x \in A = C$.
A: The actual problem is that what you wrote there are not the functions, but just two terms varying by a certain parameter.
In order to call those a function, you have to define the domain, which would look like this:
$$f: \mathbb{R}\setminus\{2, 4\}\rightarrow \mathbb{R}, x \mapsto f(x) := \frac{(x-2)(x-3)}{(x-2)(x-4)}\\
g: \mathbb{R}\rightarrow \mathbb{R}, x \mapsto g(x) := \frac{(x-3)}{(x-4)}\\$$
Now, $f\ne g$, but it equals the restriction of g to the domain of f: $f = g|_{\mathbb{R}\setminus \{2, 4\}}$
EDIT: Let me explain a bit more about how to compare terms and functions regarding equality.


*

*Functions are defined as relations with certain properties (uniqueness & definedness of the argument):
$f: A\rightarrow B, x\mapsto f(x) :\Leftrightarrow f := \{(x, y)\in A\times B|y = f(x)\}$, which has to hold $\forall x\in A\exists!y\in B: (x, y)\in f$ as the defining property of a function.

*If two functions are equal is therefore just a question of comparing two sets. It holds if both contain exactly the same elements $(x, f(x))$. Thus, they must have the same domain.

*When comparing two expressions regarding equality, one has to be careful as well: Let $f(x), g(x)$ be expressions. $f(x) = g(x)$ would not be a logical statement, because We do not know what x is — therefore, we have to give an explicit x or quantorize it: $$\forall x: f(x) = g(x)$$ Because a quantorization without limiting x to a certain set (let's say $\mathbb{R}$) would only make sense if we would concern f(x) = g(x) = x, which would allow x to be something else than a number, you have to give a domain in some way as well.
For instance, let $f(x) := \frac{x-1}{x-1}, g(x) := 1$: $\forall x\in M: f(x)=g(x)$ would hold true for M = $\mathbb{R}\setminus \{1\}$, but not for $\mathbb{R}$, because there is no $f(x)$ at $x=1$.
A: The reason we can't check functions for equality is because:
 1. It reduces to The Halting Problem
 2. Functions tend to have an infinite set of inputs, and as others have mentioned, checking functions for equality is a question of comparing two sets. 
But we could try to force both expressions to have the same format, then check symbol by symbol, I suppose.
