I know that the limit of the quotient can be found using L'Ho(s)pital's rule or by the method of dividing by the greatest exponent in the denominator. However, let's see this example
\begin{align*} \lim_{x \to \infty} \dfrac{x^4-x+1}{5x^4-9} & =\dfrac{\lim_{x \to \infty} (x^4-x+1)}{\lim_{x \to \infty} (5x^4-9)}\\[5pt] &=\dfrac{\lim_{x \to \infty} (x^4)}{\lim_{x \to \infty} (5x^4)}\\[5pt] &=\lim_{x \to \infty} \dfrac{x^4}{5x^4}\\[5pt] &=\lim_{x \to \infty} \dfrac{1}{5}=1/5. \end{align*}
The answer is right, but the method seems not. I tried to find some example of polynomials which doesn't work but I couldn't. Can anyone prove or disprove this method?
The method you utilized is not valid. This is to say, in general, $$\lim_{x\to{p}}\frac{f(x)}{g(x)}\neq\frac{\lim_{x\to{p}}f(x)}{\lim_{x\to{p}}g(x)}.$$ For example, if $\lim_{x\to{p}}g(x)=0$, then the right-hand side is not defined, since you have $\frac00$, yet the left-hand side could be well-defined and equal to any real number. In this case, the method is invalid because there exists no way to justify doing division when both limits go to $\infty$, since $\infty$ is not even a well-defined quantity you can do arithmetic with. However, you are right that it does always give the correct result in this particular context. The reason is because although $$\lim_{x\to\infty}\frac{x^4-x+1}{5x^4-9}\neq\frac{\lim_{x\to\infty}x^4-x+1}{\lim_{x\to\infty}5x^4-9}$$ and $$\frac{\lim_{x\to\infty}x^4}{\lim_{x\to\infty}5x^4}\neq\lim_{x\to\infty}\frac{x^4}{5x^4},$$ it happens that $$\lim_{x\to\infty}\frac{x^4-x+1}{5x^4-9}=\lim_{x\to\infty}\frac{x^4}{5x^4}$$ is indeed true. And this will always be the case, because $$\lim_{x\to\infty}\frac{x^4-x+1}{5x^4-9}=\lim_{x\to\infty}\frac{x^4\cdot{\left(1-\frac{1}{x^3}+\frac{1}{x^4}\right)}}{5x^4\cdot{\left(1-\frac{9}{5x^4}\right)}}=\lim_{x\to\infty}\frac{x^4}{5x^4}\cdot\lim_{x\to\infty}\frac{1-\frac{1}{x^3}+\frac{1}{x^4}}{1-\frac{9}{5x^4}}.$$ Now, you can have $y=\frac{1}{x}$, and as $x\rightarrow{\infty},y\rightarrow{0}$, with $y\gt0$. As such, $$\lim_{x\to\infty}\frac{1-\frac{1}{x^3}+\frac{1}{x^4}}{1-\frac{9}{5x^4}}=\lim_{y\to0,y\gt0}\frac{1-y^3+y^4}{1-\frac{9y^4}{5}}.$$ And you should always remember: limits to $\infty$ are always secretly just limits to 0. In particular, $$\lim_{x\to\infty}f(x):=\lim_{x\to0,x\gt0}f\left(\frac{1}{x}\right), \lim_{x\to-\infty}f(x):=\lim_{x\to0,x\lt0}f\left(\frac{1}{x}\right).$$ The vast majority of the time, this is the key to having a better understanding of a limit exercise.
Anyway, in this example $$\lim_{y\to0,y\gt0}\frac{1-y^3+y^4}{1-\frac{9y^4}{5}}=1,$$ hence $$\lim_{x\to\infty}\frac{x^4-x+1}{5x^4-9}=\lim_{x\to\infty}\frac{x^4}{5x^4}.$$ This is why your method, even though it is invalid, as you produce a categorically meaningless expression, it still gives the right answer. In fact, $$\lim_{x\to\infty}\frac{Ax^n+P(x)}{Bx^n+Q(x)}=\lim_{x\to\infty}\frac{Ax^n}{Bx^n}$$ for $P,Q$ being polynomials of degree $n-1$. The proof of this statement is =analogous to the proof I presented in the previous paragraphs. Applying your invalid method will give the correct answer, even though $$\lim_{x\to\infty}\frac{Ax^n+P(x)}{Bx^n+Q(x)}\neq\frac{\lim_{x\to\infty}Ax^n+P(x)}{\lim_{x\to\infty}Bx^n+Q(x)}$$ and $$\frac{\lim_{x\to\infty}Ax^n}{\lim_{x\to\infty}Bx^n}\neq\lim_{x\to\infty}\frac{Ax^n}{Bx^n}.$$ In essence, the invalid method gives the correct answer because your second mistake cancels out the first mistake you made, making it so that it is as if you never made the first mistake at all.