Una manera de mirar lo que una función es, y de una manera que normalmente no se introdujo hasta mucho más tarde en el de la educación matemática, es decir que en lugar de ser una regla, una función es un conjunto. En particular, una función de $f$, el cual se asigna un dominio $X$ a un codominio $Y$ es un conjunto de pares ordenados $(x,y)$ donde $x$ proviene de $X$ $y$ proviene de $Y$, y donde si tanto $(a,b)$$(a,c)$$f$$b=c$.
Esto puede parecer complicado, pero aquí es un ejemplo. Podemos definir una función de $f:\mathbb{N}\rightarrow \mathbb{N}$ (es decir, $f$ es una función donde el dominio de $f$ es los números naturales, y el codominio también los números naturales) para ser $$f(n)=n+1$$ Now we can look at this function as the set $$\{(0,1), (1,2), (2,3),\dots\}$$ The algebraic expression "$n+1$" just gives us a convenient way to specify the elements of the set $f$. You've of course looked at functions in kind of this way probably, by forming a table of values:
x | f(x)
0 | 1
1 | 2
2 | 3
..| ..
If you were able to keep writing forever and ever, you could write down every single pair, and that infinitely long table would uniquely specify the function $f$.
The question that you're asking is this: when do we say that two functions are equal? Well if we look at a function in a more general way, as set of ordered pairs rather than just as an algebraic rule, then it seems easy enough to say when two functions are equal. When things are equal, they are identical. So if two functions $g$ and $h$ are equal, then they better be made up of the exact same set of pairs.
So let's look at $f(x)=x^3/x^2$ and $g(x)=x^2/x$. Since we can't divide by $0$, it's standard to assume that $0$ is not in the domain of either of these functions-otherwise the definitions would be meaningless. So we can say that they are defined for all real numbers except 0. Now since for any number except 0, $x^3/x^2=x^2/x=x$, $f$ and $g$ have all the exact same points. Since a function is nothing but its points, that means that the two functions are identical.
But now if we cancel all the common factors we end up with another function that looks like $h(x)=x$. Is it true that $f=g=h$? Well, if we don't specify anything about the domain of $h$ then no, because $h$ contains the point $(0,0)$, and neither $f$ nor $g$ do, so they aren't identical functions. But if we specify that the domain of $h$ is all real numbers except $0$, then yes, because we've taken the point $(0,0)$ out of $h$.
So basically, cancelling common factors does not change a function as long as you keep track of the domain.
What are the implications of this? Well off the top of my head, consider the following problem, with which type you may be familiar: find the maximum of the function $$f(x)=\frac{x^2(2-x)}{x}+2x+5$$ if it exists.
So the first thing you might like to try is to cancel the common factors and write $f$ as $$x(2-x)+2x+5$$ Now, you know what that is. It's an upside down parabola, and its maximum occurs at $x=0$. But wait! There is no $x=0$ in $f$; we infer from the context that $f$ is defined on all the real numbers except for $0$. So the answer to this is actually that $f$ no tiene máximo.