Is a prime factor of a number always less than its square root?

No. Consider that the square root of $14$ is about $3.74$ but $14$ has $7$ as a prime factor. Also consider that any prime number such as $2$ is its own (only) prime factor, and any number greater than $1$ is greater than its square root. The theorem you have stated is incorrect: $25$ has no prime factor less than $5$, and $3$ has no prime factor less than $1.732$; however, it is true that every composite number has a prime factor less than or equal to its square root.


You seem to be confused with another statement, which is that the smallest prime factor of a composite number N is less than or equal to $\sqrt N$.


Proof: Suppose $n$ is a positive integer s.t. $n=pq$, where $p$ and $q$ are prime numbers. Assume $p>\sqrt{n}$ and $q>\sqrt{n}$. Multiplying these inequalities we have $p.q>\sqrt{n}.\sqrt{n}$, which implies $pq>n$. This is a contradiction to our hypothesis $n=pq$. Hence we can conclude that either $p\leq \sqrt{n}$ or $q \leq \sqrt{n}$.


There can be at most $1$ prime factor of $n$ greater than $\sqrt{n}$.

Proof: If possible let there be two distinct prime factors of $n$ which are greater than $\sqrt{n}$, say $a$ and $b$. As both $a$ and $b$ are different prime factors of $n$ their product $c = a \times b$ should also be the factor of $n$. But $c$ would exceed $n$ as both $a$ and $b$ are greater than $\sqrt{n}$, which contradicts our assumption, hence there can only be one prime factor of $n$ greater than $\sqrt{n}$.

Application: If u want to do prime factorization of $n$ then you only need primes up to $\sqrt{n}$ which largely improves the complexity of prime factorization. The number left after repeatedly dividing $n$ with all primes factors less than $\sqrt{n}$ is indeed a prime or $1$.

Repeatedly dividing $n$ with all primes factors less than $\sqrt{n}$:

You iterate over all primes less than $\sqrt{n}$. If the current prime $p$ divides $n$ you keep on dividing $n$ by $p$ until $n$ becomes $1$ or the $p$ no longer divides $n$. In the end, either $n$ will become $1$ or some number greater than $\sqrt{n}$ would be left which would also be a prime factor of $n$ but it will be the only prime factor which is greater than $\sqrt{n}$


It doesn't mean that every factor of $n$ would be less that $\sqrt{n}$, in fact at least one factor would be less than $\sqrt{n}$ if $n$ is not a prime number. Explanation: $$ n=\sqrt{n}\cdot \sqrt{n},\quad n=a\cdot b, $$ so 1) if one factor is less than $\sqrt{n}$ then other will be greater than $\sqrt{n}$, 2) if there is no such factor less than $\sqrt{n}$ then both factors would be greater than $\sqrt{n}$ but it's not possible; so, that number must be prime if it doesn't have a factor less than $\sqrt{n}$.