The following answer assumes you are familiar with linear algebra and matrix factorization. The basic idea is to express both the Pearson correlation and $R^2$ in terms of vector of observations (and intercept).
Suppose you have made $n$ observations $(x_i, y_i): i = 1, 2, \ldots, n$, denote the column vector $(y_1, y_2, \ldots, y_n)'$ and the column vector $(x_1, x_2, \ldots, x_n)'$ by $y$ and $x$ respectively. Moreover, denote the $n$-long column vector of all ones by $e$. The design matrix $X$ thus can be written as $X = \begin{bmatrix}
e & x \end{bmatrix}$. Let $X = QR$ be the QR decomposition of $X$, where $Q = \begin{bmatrix}
q_1 & q_2\end{bmatrix}$ is column-wise orthogonal, i.e., $q_1'q_1 = q_2'q_2 = 1$ and $q_1'q_2 = 0$.
With these preparations, it is readily seen that the Pearson correlation $r$ is
\begin{align}
r = \frac{\sum(x_i - \bar{x})(y_i - \bar{y})}{\sqrt{\sum(x_i - \bar{x})^2\sum(y_i - \bar{y})^2}} = \frac{x'(I - q_1q_1')y}{\sqrt{x'(I - q_1q_1')x \cdot y'(I - q_1q_1')y}}. \tag{1}
\end{align}
While the coefficient of determination is given by
\begin{align}
R^2 = \frac{\sum(\hat{y}_i - \bar{y})^2}{\sum(y_i - \bar{y})^2}
= \frac{y'(H - q_1q_1')y}{y'(I - q_1q_1')y}
= \frac{(y'q_2)^2}{y'(I - q_1q_1')y}, \tag{2}
\end{align}
where $H = X(X'X)^{-1}X' = QQ' = q_1q_1' + q_2q_2'$ is the so-called hat matrix. It thus follows by $(1)$ and $(2)$ that to show $R^2 = r^2$, it is sufficient to prove
\begin{align}
(x'(I - q_1q_1')y)^2 = (y'q_2)^2 \times x'(I - q_1q_1')x. \tag{3}
\end{align}
Since $x$ is in the space spanned by two orthonormal vectors $q_1$ and $q_2$, we have $x = (x'q_1)q_1 + (x'q_2)q_2$, whence
\begin{align}
& x'(I - q_1q_1')x = \|x\|^2 - (x'q_1)^2 = (x'q_2)^2, \\
& x'(I - q_1q_1')y = ((x'q_1)q_1' + (x'q_2)q_2')(y - q_1q_1'y) = (x'q_2)q_2'y.
\end{align}
Hence $(3)$ holds. This completes the proof.