RSA Encryption Explanation
What you have (after generating the keys):

$$ \gcd(p, q) = 1 $$
$$ N = pq $$
and a number $e$ and it's inverse $d$, modulo $\phi(N)$. That is:
$$ ed \equiv 1 \pmod{\phi(N)}$$



Encryption:
$$ c \equiv m^e \pmod{N}$$
Decryption:
$$ m^\prime \equiv c^d \pmod{N} $$
$$ m^\prime \equiv (m^e)^d \equiv m^{ed} \pmod{N} $$

We don't yet if $m^\prime \equiv m$.

Well... you can use Euler's Theorem:
$$ a^{\phi(N)} \equiv 1 \pmod{N}, \text{ if } \gcd(a,N) = 1. $$

Write $ed = 1 + k~\phi(N)$:
$$ m^\prime \equiv m^{1+k\phi(N)} \pmod{N}$$
$$ m^\prime \equiv m\cdot m^{k\phi(N)} \pmod{N}$$
$$ m^\prime \equiv m\cdot \underbrace{m^{k\phi(N)}}_{1} \pmod{N}$$

So $m^\prime \equiv m \pmod{N}$.