At first, I figured that an automorphism of a scheme $X$ would be a homeomorphism $f:|X| \to |X|$ of topological and an isomorphism of sheaves $f^{\#}: \mathcal{O}\_X \to f\_\*(\mathcal{O}\_X)$. 


However, if $X= \mathbb{P}\_k^n$, then the automorphisms of $X$ are actually defined as follows: 


Let $\textbf{Aut}(\mathbb{P}^n)$ denote the functor taking a scheme $S=\operatorname{Spec}A$. where $A$ is a commutative algebra over an algebraically closed field $k$, to the group of automorphisms $\operatorname{Aut}\_A(\mathbb{P}\_A^n)$ of $\mathbb{P}\_A^n$ over $A$.


I think the definition means that we need to look at the "automorphisms of all $A$-points of $\mathbb{P}\_k^n$". I'm not sure if this last phrase is correct, I've just heard it being said. 


However, how does this naturally follow from the "naive" interpretation of what an automorphism of a scheme $X$ would be? I can't figure out why or when the $A$-points of a scheme are of significance. 
For example, when Hartshorne discusses the automorphism group of $\mathbb{P}\_k^n$ he determines it to be $PGL(n, k)$, i.e he really only considers the $k$-points of the group scheme $\textbf{PGL}(n)$. 



Automorphisms of Schemes and their $A$-points
I just organized my comments into an answer/review (though the existing answers are already perfect).


**Schemes over $k$.**


The category $Sch\_S$ of schemes over a given scheme $S$ is by definition the comma category over $S$, i.e. objects are morphisms of schemes $\pi:X\to S$ and arrows are morphisms of schemes making the resulting diagram commute. 
For $S=\mathrm{Spec}k$ we get the category $Sch\_k$ of $k$-schemes. We will denote by $Sch$ the category of plain schemes over the integers (though in real life I'd not dare touching anything that is not, say, over $\mathbb C$...).


There is a forgetful functor $u:Sch\_k \to Sch$, $(X\to \mathrm{Spec}k)\mapsto X$ sending a $k$-scheme to its underlying ($\mathbb Z$-) scheme. Notice that while e.g. $Spec\mathbb{C}\in Sch\_\mathbb{C}$ is a one point scheme, $u(Spec\mathbb{C})\in Sch$ is a pretty messy object. 


There is also a base change functor $b\_k:Sch\to Sch\_k$, $X\mapsto (X\times\_{Spec \mathbb Z}Spec k\to Spec k)$. Notice that $b\_k$ is definitely not the inverse of $u$ (e.g. $\mathbb{C}\otimes\_{\mathbb Z}\mathbb{C}\neq \mathbb C$, and $\mathbb{Z}\otimes\_{\mathbb Z}\mathbb C\neq \mathbb Z$).


Given $X$ over $k$, there are the two corresponding functors of points, $h\_{X/k}:Sch\_k^{op}\to Set$ and $h\_{X/\mathbb Z}:Sch^{op}\to Set$. The former is not "the restriction" of the latter: $Sch\_k$ is not a subcategory of $Sch$, rather a comma category. 


Notice that $h\_{X/k}\neq h\_{X/\mathbb Z}\circ u$ (where I've still called $u:Sch\_k^{op}\to Sch^{op}$): take e.g. $X=Speck$ and evaluate both functors at $T=Speck$. What you can say in general is $h\_{X/k}\subseteq h\_{X/\mathbb Z}\circ u$ is a subfunctor. Likewise, $h\_{X/\mathbb Z}\neq h\_{X/k}\circ b\_k$: take e.g. $X=Speck$ and evaluate at $T=Spec\mathbb Z$. 


What's the relationship between $\mathbb{P}^n\_{\mathbb Z}$ and $\mathbb{P}^n\_k$? The latter is just the image of the former under the functor $b\_k$. But the functor of points of $\mathbb{P}^n\_k$ is not a restriction of the functor of points of $\mathbb{P}^n\_{\mathbb Z}$, it's really another functor: it gives the set of only morphisms *over* $k$ as opposed to all the morphisms. 


Notice that the automorphism group of a $k$-scheme $X$ *as a $k$-scheme* i.e. in $Sch\_k$ may be completely different from the automorphism group of $X$ as a plain scheme. Consider for example $X=Spec\mathbb{C}$: $Aut\_{\mathbb C}(X)$ is trivial, while $Aut\_{\mathbb Z}(X)$ is all the ring automorphisms of the $\mathbb Z$-algebra $\mathbb C$.


The same happens for projective space. Consider the $k$-scheme $\mathbb{P}^n\_k$. If we consider it in $Sch\_k$, then its $Aut$ is $PGL\_n(k)$. I don't know what happens over the integers, but if we consider $\mathbb{P}^n\_k$ as a scheme over the prime field $k\_0$ of $k$, then $Aut$ is a semidirect product of $PGL\_n(k)$ and the Galois group of $k$ over $k\_0$. [Apparently](https://en.wikipedia.org/wiki/Collineation#Fundamental_theorem_of_projective_geometry), the $Aut\_{k\_0}$ is the automorphism group of the abstract projective geometry (in the sense of incidence structures) induced by $\mathbb{P}^n\_k$.




---


**Automorphisms functor.**


This is an aspect orthogonal to the above one. Let's consider everything in $Sch\_k$ for simplicity. 


The automorphisms functor of $X\in Sch\_k$ is defined by $\mathbf{Aut}\_k(X):S\mapsto Aut\_S(X\times\_k S)$, where $Aut\_S$ denotes automorphisms in $Sch\_S$ for every $S\in Sch\_k$. 


Now you see that, whether this is representable or not, we can talk about the $k$-points of $\mathbf{Aut}\_k(X)$ and it is obvious from the definition that $(\mathbf{Aut}\_k(X))(k)=Aut\_k(X)$ as abstract groups. So, the automorphisms functor is designed to have as its $k$-points precisely the automorphisms of $X$ as an object of $Sch\_k$. 


What about more general points of $\mathbf{Aut}\_k(X)$? You can think of $X\times\_k S$ as a trivial $X$-bundle over $S$. An $S$-point $\sigma$ of $\mathbf{Aut}\_k(X)$ is an isomorphism $\sigma:X\times S\to X\times S$ that commutes with projections to the base $S$. So you can see $\sigma$ as a "bundle automorphism" of $X\times\_k S$, or as a family of automorphisms of $X$ parametrized by $S$.


