Why is $S(y) = y^{2^8-2} = y^{254}$ a one-to-one function and a permutation on $GF(2^8)$ I'm taking a course on cryptography and I have some confusions concerning the materials in our notes. Say we have the field $GF(2^8)$, we create a substitution algorithm (the S Box in AES) so we need a bijective function that maps from $GF(2^8)$ onto itself. 

The total number of one-to-one functions is 256! because $| GF(2^8)| = 256$ and we can find a mapping by permutating all elements within the set. 

We use the mapping function $S(y) = y^{2^8-2} = y^{254}$ which is a permutation on $GF(2^8)$

Why is this a permutation? How do we show this?

It is also mentioned in other notes such as here: SubBytes Transform circuit for AES Cipher (Version 1.0) 

that 

$S(y) = y^{-1}$ for all $y \neq 0$
and 
$y^{255} = 1$

I don't understand why however. 

Just to summarize, I don't understand 
why  $S(y) = y^{2^8-2} = y^{254}$ is a one-to-one function and a permutation on  $GF(2^8)$ and why $S(y) = y^{-1}$ for all $y \neq 0$

Could someone help explain the details behind? Thanks!
Fact 1: the order of the field $GF(2^8)$ is $2^8$, hence the order of its multiplicative group $GF(2^8)^{\times} := GF(2^8) \setminus \{0\}$ is $2^8-1 = 255$.

Fact 2: For a group $G$ of order $q$, any element $g \in G$, when raised to the power of $q$ is equal to 1: mathematically put,  $g^q =1$. 

Fact 3: for any element in a group there exists a unique inverse. An inverse to $g$ is an element (denoted by $g^{-1}$) that satisfies $g \cdot g^{-1} = 1$. In other words, the function $g \mapsto g^{-1}$ is one-to-one.

In our case, any element $g \in GF(2^8)^{\times}$ satisfies $g^{255} = 1$. Another, useful way to write this is that for any $g$ we have $g \cdot g^{254} =1$. Since $g \cdot g^{254}= g^{255} = 1$ we have that $g^{254}$ is equal to $g^{-1}$.           

We conclude that the function $g \mapsto g^{254}$ is equal to the function $g \mapsto g^{-1}$ which is one-to-one, hence it is a permutation of the group  $GF(2^8)^{\times}$.

I'd be happy to elaborate on any unclear part.