Let $X$ be a scheme. If $X$ happens to be affine then is it true that the canonical morphism
$$X\to\mathrm{Spec}\;\Gamma(X,\mathcal{O}_X)$$
is an isomorphism?.
Let $X$ be a scheme. If $X$ happens to be affine then is it true that the canonical morphism
$$X\to\mathrm{Spec}\;\Gamma(X,\mathcal{O}_X)$$
is an isomorphism?.
Yes. Moreover, this property characterizes affine schemes among all locally ringed spaces. See this MO comment for a proof sketch.