TITLE: Classical number theoretic applications of the $p$-adic numbers
QUESTION [16 upvotes]: I am sure we can all agree that the $p$-adic numbers are highly fascinating objects in their own right - just as the closely related theory of valuations.
Having independently read up on the $p$-adic numbers for a few weeks now, I have so far only seen one application of them to what I would call classical number theory - namely the proof given in Serre's Cours d'arithmétique that a natural number is expressible as the sum of $\leq 3$ squares if and only if it is not of the form $4^a(8b-1)$ for some $a,b \in \mathbb{N}$.
Since I have a tendency to appreciate the value of the higher theories of mathematics in proportion to their applications to elementary number theory, I immediately found myself wondering if there are any other applications.
So my question to the community is: What are the most delightful applications of the $p$-adic numbers and the theory of valuations to elementary number theory?
Many thanks.
P.s.: I am aware that there are already several posts on the forum about the applications of the $p$-adic numbers, but none that refers to elementary number theory specifically.
Edit: I agree that I have been too vague in what I mean by "elementary number theory", so I will try to be a little more specific: By a classical "elementary" number theoretic proposition, I mean a number theoretic proposition that Fermat might have come up with. Thus, the above proposition about the sum of three squares is an elementary number theoretic proposition, as is e.g. Fermat's Last Theorem and the Twin Prime Conjecture, while e.g. the BSD Conjecture or the Class Number Problem are not.
Edit 2: Thank you for all the answers below - they are all excellent! In case anyone should come up with another one, I should like to say that bonus-points are given for results that have so far only been proven using the theory of $p$-adic numbers, or whose proof using $p$-adic numbers is far more conceptual and insightful than the original / more elementary one.

REPLY [2 votes]: One well known application of $p$-adic numbers is the Hasse-Minkowski theorem for quadratic forms.
This states that if $P$ is an irreducible quadratic form in any number of variables $n$, then the equation $P(x_1,\dots,x_n)=0$ has rational nonzero solutions if and only if it has nonzero solutions with coefficients in $\mathbb{R}$ and $\mathbb{Q}_p$ for every prime $p$.
This result is a very powerful tool in determining whether such an equation has any rational solutions, since if $n\geq 3$, the Chevalley-Warning theorem implies that the equation $P(x_1,\dots,x_n)=0$ has a nonzero solution modulo $p$ for every prime $p$. Combining this with Hensel's lemma, we see that the only primes that need to be checked are those for which $P$ is reducible modulo $p$.