The "if" part is clear, so we'll deal with the "only if". Moreover, we take the polynomials to be "true" quadratics ---that is, $p$ and $q$ are non-zero--- since otherwise the proposition is false (as @Winther mentions in a comment to the OP).
First, note that quadratics with a common root could have both roots in common, in which case they are equivalent. This means that multiplying-through by some $k$ turns one quadratic equation into the other, coefficient-wise:
$$q = k p, \quad r = k q, \quad p = k r \quad\to\quad p = k^3 p \quad\to\quad p(k^3-1) = 0 \quad\to\quad k^3 = 1$$
Thus, since $k=1$, we have $p = q = r$.
If the quadratics don't (necessarily) have both roots in common, but do have root $s$ in common, then
$$\left.\begin{align}
p s^2 + q s + r &= 0 \quad\to\quad p s^3 + q s^2 + r s \phantom{+p\;} = 0 \\
q s^2 + r s + p &= 0 \quad\to\quad \phantom{p s^3 +\, } q s^2 + r s + p = 0
\end{align} \quad\right\}\quad\to\quad p(s^3-1) = 0 \quad\to\quad s^3 = 1$$
Thus, since $s = 1$, substituting back into either polynomial gives $p+q+r=0$.
Easy-peasy!
But wait ... The equations $k^3 = 1$ and $s^3 = 1$ have fully three solutions: namely, $\omega^{0}$, $\omega^{+1}$, $\omega^{-1}$, where $\omega = \exp(2i\pi/3) = (-1+i\sqrt{3})/2$. Nobody said coefficients $p$, $q$, $r$, or common root $s$, were real, did they?
If $k = \omega^n$, then we have in general that
$$q = p \omega^n \qquad r = p \omega^{-n}$$
If $s = \omega^n$, then substituting back into either quadratic, and multiplying-through by an appropriate power of $\omega^{n}$ for balance, gives
$$p\omega^{n} + q + r \omega^{-n} = 0$$
Just-slightly-less-easy-but-nonetheless-peasy!
$$a\alpha^2-2b\alpha+5=0\tag{1}$$
$$\alpha^2-2b\alpha-10=0\tag{2}$$
Subtracting $(1)$ and $(2)$
$$\alpha^2(a-1)+15=0$$
$$\alpha^2=\dfrac{15}{1-a}$$
From the first equation $$\alpha^2=\dfrac{5}{a}$$
$$\dfrac{15}{1-a}=\dfrac{5}{a}$$
$$3a=1-a$$
$$a=\dfrac{1}{4}$$
As first equation has equal roots
$$D=0$$
$$b^2-5a=0$$
$$b^2=\dfrac{5}{4}$$
So finally $\alpha^2+\beta^2=(\alpha+\beta)^2-2\alpha\beta$
$$\alpha^2+\beta^2=(2b)^2+20=4b^2+20=25$$
So $25$ is your answer.
Best Answer
If $x^3 + 5x^2 + px + q = 0$ and $x^3 + 7x^2 + px + r = 0$ have two common roots then there must exists a common monic binomial factor, $F(x)$.
So $F(x)$ must be a divisor of
$$(x^3 + 7x^2 + px + r) - (x^3 + 5x^2 + px + q) = 2x^2 - (q - r) $$
So $F(x) = x^2 - \dfrac 12(q - r)$.
So, for some $s$ \begin{align} x^3 + 7x^2 + px + r &= F(x)(x-s) \\ &= \left[x^2 - \dfrac 12(q - r)\right](x-s)\\ &= x^3 - sx^2 - \dfrac 12(q - r)x + \dfrac 12(q - r)s\\ \hline s &= -7 \\ p &= -\dfrac 12(q - r) \\ r &= -\dfrac 72(q - r) \\ \hline s &= -7 \\ p &= \dfrac 15 q \\ r &= \dfrac 75 q \end{align}
And, for some $t$ \begin{align} x^3 + 5x^2 + px + q &= \left[x^2 - \dfrac 12(q - r)\right](x-t)\\ &= x^3 - tx^2 - \dfrac 12(q - r)x + \dfrac 12(q - r)t\\ \hline t &= -5 \\ p &= -\dfrac 12(q - r) \\ q &= -\dfrac 52(q - r) \\ \hline t &= -5 \\ p &= \dfrac 15 q \\ r &= \dfrac 75 q \end{align}
So the third roots are $-7$ and $-5$.
Reality check:
So, suppose $p = -\dfrac 15 q, r = \dfrac 75 q$. To get rid of the fractions, lets let q = 10k.
Then