The problem is to find the domain of the function $f(x)$, where
The factoring procedure that you used is sensible, particularly when factoring is easy.
As you observed, the number $x$ is in the domain of $f$ iff $(x-1)(x-4) \ge 0$.
This is the case if (i) both $x-1$ and $x-4$ are $\ge 0$ and (ii) if both $x-1$ and $x-4$ are $\le 0$.
Case (i) happens if $x \ge 1$ and $x\ge 4$, or more simply if $x \ge 4$.
Case (ii) happens if $x \le 1$ and $x \le 4$, or more simply if $x \le 1$.
Thus the domain of $f(x)$ is the union of the two sets that correspond to cases (i) and (ii). Compactly, we could write that the domain is
$$(-\infty,1] \cup [4,\infty).$$
Comment: A product like $(x-a)(x-b)(x-c)\cdots$ cannot change sign except possibly at $a, b, c, \cdots$. We have written possibly because for example $(x-1)(x-1)(x-2)$ does not change sign at $x=1$.
So to find out about the sign of $(x-1)(x-4)$ it would be enough to test at some $x<1$, some $x$ between $1$ and $4$, and some $x$ greater than $4$. Draw a picture of the number line to help decide on the test points, and to give concreteness to the problem. Playing with inequalities can be treacherous, all inequalities kind of look the same. Without a geometric context, mistakes are all too likely. I have a feeling that you will find there are fewer accidents if you use the above testing procedure, at least as backup.
The "inspection" procedure that you used failed for the same reason that the systematic procedure failed. In the inspection procedure, you write "$x(x-5) \ge 0$ which gives either $x \ge 0$ or $x \ge 5$, that means $0$ and all the positive numbers." This is not true, the product is $\ge 0$ when both $x \ge 0$ and $x \ge 5$ hold. In particular, $x(x-5)$ is negative at, for example, $x=2$. But anyway, the sign of $x(x-5)$ is irrelevant. We are interested in whether $x^2-5x +4 \ge 0$, that is, whether $x^2-5x \ge -4$. The sign of $x(x-5)$ does not supply the needed information.
An inspection procedure can, in some cases, succeed. But the systematic algebraic/geometric method is far more reliable. Another way of looking at things is to look at the parabola $y=x^2-5x+4$. This parabola is upward-facing, and crosses the $x$-axis at $x=1$ and $x=4$. So $x^2-5x+4$ is negative in the interval $(1,4)$.