Can you factor before finding derivative? Say the function is $y=\frac{x^2-1}{x-1}$
Can you factor functions before finding the derivative or does that not work?

The functions $f(x) = \dfrac{x^2-1}{x-1} = \dfrac{(x-1)(x+1)}{x-1}$ and $g(x) = x+1$ are equal at every real number $x$ except $x = 1$, where $f(x)$ is undefined, but $g(x)$ is defined. 
Therefore, $f'(x) = g'(x) = 1$ at every real number $x$ except $x = 1$. 
If you used the quotient rule, you get 
$f'(x) = \dfrac{(x-1)(2x)-(x^2-1)(1)}{(x-1)^2} = \dfrac{x^2-2x+1}{(x-1)^2} = \dfrac{(x-1)^2}{(x-1)^2} = 1$ (provided $x \neq 1$). 
So, yes, you can factor and simplify the function before computing the derivative, but you must be careful to not enlarge the domain of the function or its derivative.
