Let us identify the underlying topological spaces of $X$ and $\operatorname{Spec}(A)$ and write $O_A$ for the structure sheaf of $\operatorname{Spec}(A)$. So we have a topological space $X$ with two different sheaves of rings $O_X$ and $O_A$ that make it a scheme, with a map $O_A\to O_X$. We will show that $O_X$ is a quasicoherent $O_A$-module.
Fix a point $x\in X$. Take an $O_X$-affine open neighborhood $V$ of $x$; say $(V,O_X|_V)$ is isomorphic to $\operatorname{Spec}(B)$ for some ring $B$. The composition $V\to X\to\operatorname{Spec}(A)$ induces a homomorphism $\varphi:A\to B$. Now take an element $a\in A$ such that the distinguished open set $U=D(a)\subseteq\operatorname{Spec}(A)$ satisfies $x\in U\subseteq V$. Note that the distinguished open subset $D(\varphi(a))\subseteq \operatorname{Spec}(B)=V$ has the same points as $D(a)$. We conclude that $U$ is an open neighborhood of $x$ which is affine as a subscheme of both $X$ and $\operatorname{Spec}(A)$. It follows that $O_X|_U$ is a quasicoherent $O_A|_U$-module: this is just the fact that if $f:Y\to Z$ is a map of affine schemes, $f_*O_Y$ is quasicoherent.
Since quasicoherence is a local property and $x\in X$ was arbitrary, we conclude that $O_X$ is a quasicoherent $O_A$-module. Since $\operatorname{Spec}(A)$ is affine, this means it is determined by its global sections, so the assumption that $O_A\to O_X$ is an isomorphism on global sections implies it is an isomorphism of sheaves. It follows that $X\to \operatorname{Spec}(A)$ is an isomorphism of schemes.
(Incidentally, the real work in this argument is being hidden in the (nontrivial!) fact that every quasicoherent sheaf on $\operatorname{Spec}(A)$ is determined by its global sections (i.e., that sheaves on affine schemes that are locally induced by modules are globally induced by modules).)