Let $a$ and $b$ be the endpoints of an arbitrary maximal path $P$ in $G$. Then all neighbours of $a$ and $b$ lie in $P$.
It is easily seen that $a$ and $b$ are not cut-vertices: If $x$ and $y$ are vertices connected through a path $P' = x \dots v a v' \dots y$, we can always find a new path which doesn't contain $a$ but connects $x$ and $y$ (this is because $v,v' \in P = a v_1 \dots v_k b$). Similarly for $b$. Because $a$ and $b$ are the only two 'non-cut-vertices' in $G$, we conclude that every maximal path $P$ in $G$ must have $a$ and $b$ for its endpoints. It follows that $G$ is connected: for every vertex $v$ there is a maximal path $P_v$ that contains $v$ and its endpoints are $a$ and $b$.
Now, let $P=a v_1 v_2 \dots v_k b$ be a maximal path and suppose there exists a vertex $x \notin P$. Because $x$ is a cut-vertex $G \setminus \{x\}$ has at least two connected components: $P \subset C_1$ and $y \in C_2$, $C_1 \cap C_2 = \varnothing$. But in $G$, there exists a path $P_y = a \dots y \dots b$. The vertex $x$ can't be at the same time in the first 'half' $a \dots y$ and the second 'half' $y \dots b$ of the path $P_y$, for example $x \notin a \dots y$. Then $a \dots y \subset G \setminus \{x\} \implies y \in C_1$ which is a contradiction.