We can prove this using reduction of order. First, if the auxiliary equation has a repeated root, the equation will be in the form
$$ \frac{d^2y}{dx^2} - 2k \frac{dy}{dx} + k^2y = 0 $$
for some $k$. (If $a_2=0$, the equation is not second-order, so we can divide by it, and "$b^2-4ac=0$" then implies that the coefficient of $y$ is related to the coefficent of $dy/dx$ as above.)
We know a solution to this equation: $y=e^{kx}$, since the repeated root is $k$. Put $y=e^{kx}u$, and then
$$ y' = e^{kx}(u'+ku) \\
y'' = e^{kx}(u''+2ku'+k^2u) $$
by the product rule, where $y'$ stands for $dy/dx$ and so on. Substituting these into the differential equation gives a differential equation for $u$:
$$ 0 = y''-2ky'+ k^2 y = e^{kx} ( u''+2ku'+k^2u -2ku' -2k^2u +k^2u ) = e^{kx}u''. $$
Therefore, $u''=0$, so $u=Ax+B$ for some constants $A$ and $B$, as expected.
It may not be obvious from the above what actually happened. Let's go back to the general differential equation, $y''+2by'+cy=0$. Substituting $y=e^{kx}u$ in here gives
$$ 0 = e^{kx} (u''+2ku'+k^2u + 2bu'+2bku+cu) = 0. $$
Dividing by the exponential and collecting derivatives of $u$ gives
$$ 0 = u'' + 2(k+b)u' + (k^2+2bk+c)u. $$
Therefore, to get rid of the $u$ term (and enable us to integrate once for free) we need to have $k$ a root of $k^2+2bk+c$. When this is the case, in general this simplifies the equation to $u''+2(k+b)u'=0$, which integrates to
$$ u'+2(k+b)u' = A. $$
But $-2b$ is the sum of the roots of $k^2+2bk+c$, so $k+b=0$ if and only if the roots are equal, which leads to the same integration as before. If the roots are not equal, we have to do the usual integrating factor stuff, leading to
$$ (ue^{2(k+b)x})' = Ae^{2(k+b)x} \implies u = \frac{A}{2(k+b)} + Be^{-2(k+b)x}, $$
and of course $-2b-k$ is the other root of $k^2+2bk+c$, so if you substitute back in, you get back the usual unequal roots solution.