Is $f(x) = \dfrac{x^2 -4x + 4}{x - 2}$ the same as $g(x) = x - 2 $? Is $$f(x) = \dfrac{x^2 -4x + 4}{x - 2}$$ the same as $$g(x) = x - 2?$$
Why yes? Why not?
 A: Yes and no. The answer depends on subtle issues you are probably not really aware of yet. But I will try to describe different contexts where we can answer your question.

If we intended


*

*$x$ to be a variable ranging over real numbers that are not $2$

*$f$ and $g$ to be defined as real-valued functions on the set of real numbers that are not $2$


then $f$ and $g$ are indeed the same function, because they have the same source and target and they have the same value at each point of the source.

If we intended


*

*$x$ to be a variable ranging over all real numbers

*$f$ and $g$ to be defined as real-valued partial functions on the set of real numbers


You've probably not heard the phrase "partial function" before, but you probably know the idea: a function is supposed to associate a value to every element of its source. A partial function, however, is allowed to omit some (or even all!) elements of the source.
$f$ and $g$ are not the same partial function. While they have the same source and target, they differ in the fact that $g$ is defined at $2$ and $f$ is not. Thus, they are not the same partial function.

Interlude: regarding the previous two examples, there is some conventional sleight of hand that muddies the waters here. Most people are not explicitly taught the notion of "partial function", so when pressed on the technical detail, they will usually say that what they've written is shorthand for something else; e.g. when they define $f(x) = 1/x$ on the real numbers, they will say what they "really meant" was that we are working in the nonzero real numbers, not all real numbers, and $f$ to be a function on the nonzero real numbers.
This makes questions like the one you asked somewhat confused; what does the question really mean? Is this problem meant to be working in the set of real numbers that are not $2$? Are we not supposed to adopt that convention for the definition of $g$? Are we supposed to adopt the convention when comparing $f$ and $g$?
I don't think there is an easy answer; I've seen people mean all sorts of things, and worse think that there is actually no ambiguity here.

There is yet another convention! Rather than taking things literally, it is often more convenient to continuously extend the results of all calculations. e.g. rather than take the definition of $f$ literally as given, and in particular with $2$ not in its domain, the actual meaning is that we are supposed to extend $f$ by filling in all the holes that we can; in particular, by setting $f(2) = 0$.

For yet another context, I need to describe the difference between a "polynomial" and a "polynomial function". When studying polynomials, we might use $x$ to mean an "indeterminate variable" $x$, which is not a variable in the sense you're familiar with: it is not some sort of stand-in for an unknown real number, but is instead its own sort of mathematical object, that we can do addition and subtraction and multiplication with.
(more complicated operations like square roots or taking the cosine are a more subtle issue, and fall outside the topic of polynomials and into more sophisticated mathematical constructs)
Two polynomials are the same if and only if when written as a sum of monomials (e.g. like $x^2 + 3x + 2$ rather than as $(x+2)(x+1)$), all of the monomials are the same. e.g. $x+1$ and $1+x$ are the same, but $x^2+2$ is different.
Of course, polynomials closely resemble functions, and there is even the "evaluation at $a$" operation, in which we replace every occurrence of $x$ in a polynomial with $a$. 
Because the ideas of polynomials and polynomial functions are so very similar, people don't often distinguish between them, or even know there is a difference. Especially at introductory levels, because you would have to delve into the topic of "what is $x$?".
The point of that diversion is that there is a sense in which we can divide polynomials too; a "rational function" is a fraction made of of polynomials, just like a "rational number" is a fraction made of integers. Unfortunately, there isn't terminology to distinguish between fractions made of polynomials and fractions made of polynomial functions.
So if your problem is about fractions of polynomials, then $f$ and $g$ are, in fact, the same rational function, because we can cancel $x-2$ out from the numerator and denominator in $f$.
A: The first thing to realize (which you may have already) is that their domains are different. You can't put $x = 2$ into the first one. Hence, the first equation will not include the points $x = 2$ (its graph will have a hole there) while the second equation will.
The functions agree wherever they are defined, however.
A: Let me ask you another question, Do you think that expressions like $$\dfrac{x}{x}=1$$ and $$\dfrac{1}{\Big(\dfrac{1}{x}\Big)}=x$$ are valid for all $x$ ?
The answer is NO. Because both are undefined at $x=0.$
Similar argument explains, why your two functions are different. 
