The curve in your picture depicts the $H_2^+$ potential curves. Note that the ion consists of 3 particles so it can not be solved analytically. In the Born-Oppenheimer approximation you assume a constant separation $R$ of the two protons. This allows you to solve the resulting Schrödinger equation for a given value of $R$. The energy depicted in the diagram is then the expectation value of energy of the resulting state $E = \langle \psi | H |\psi\rangle$.
A different approach which is slightly more illustrative is to just take the hydrogen orbitals and just use a linear combination as an approximation for the orbital of the electron in the $H_2^+$ ion. As a first approximation assume then that the electron is in a 1s orbital at proton 1 or 2. This wavefunction would look like
$$
|\psi^{\pm}\rangle \propto |1s\rangle_1 \pm |1s\rangle_2
$$
If you imagine the plus combination $\psi^{+}$ since the 1s orbitals from the two protons will show slight overlap there will be an increased likelihood of finding the electron inbetween the protons. This means that the coulomb repulsion between them is reduced and leads to a bound state. Note here that if you bring the protons close together this won't be the case anymore and lead to the expected repulsion you see in the diagram. On the otherhand if you go from the bound state and increase the distance the coulomb force will fall of and you will simply be left with the a hydrogen atom and a proton.
The minus $\psi^{-}$ wavefunction will lead to a decreased likelihood of finding the electron between the protons and as such won't reduce the energy of the system. This state is therefore antibonding, because it will naturally dissociate.