Here are two groups. One that has infinite order and one that doesn't. While the one that doesn't may seem overcomplicated there is a reassuringly easy way to prove that it's infinite.

Finite: with the binary operation of function composition. To prove that each element has finite order we use the following theorem:

Theorem: Let be a finite group, then for each we have that .

Proof: Suppose not. Then, must all be distinct, for to suppose that contradicting the assumption that . Thus, since is closed under multiplication it follows that and so . Contradiction.

Infinite: Let be an infinite set and be defined as above. Then, . To see this suppose not. Then, . Select elements and consider . Clearly and given by the obvious mapping is an embedding and . Thus, . But, by our assumption and so Lagrange's theorem implies that . Contradiction.

Does that answer your question? There are infinite groups whose elements all have finite order though. For example where each is a copy of