Q:

Does Hom(X,Spec R) = Hom(R, O(X)) hold for algebraic stacks?

For an affine scheme $Spec R$ and a scheme $X$ we know that $Hom(X,Spec R) = Hom(R,\Gamma(X,\mathcal{O}_X))$.
Does it still hold when we replace $X$ with an algebraic stack?
My guess is yes as $Hom(-,Spec R)$ glues like a sheaf and given an algebraic stack we can consider an atlas and the hypercovering given by it (whatever it may mean).

A:

I think this is true.
Take a smooth atlas $U\to X$, and notice that sections of $\mathcal{O}_X$ (which you can see as morphisms of quasi-coherent sheaves $\mathcal{O}_X \to \mathcal{O}_X$) correspond to sections of $\mathcal{O}_U$, such that the two restrictions to $U_1:=U\times_X U$ by means of the two projections to $U$ coincide.
This is also true of morphisms out of $X$: a morphism $X\to T$ where $T$ is a scheme corresponds to a morphism $U\to T$ such that the two compositions $U_1\to U\to T$ coincide (basically because $Hom(-,Spec R)$ is a sheaf, as you said).
This reduces the question to the fact that morphisms $U\to Spec R$ such that the two compositions $U_1\to Spec R$ coincide correspond to morphisms $R\to \mathcal{O}_U(U)$ such that the two compositions $R\to \mathcal{O}_{U_1}(U_1)$ coincide.

