$p,q$ primes.
prove $p=q$ if and only if $p$ divides $q$.
$p|q$ stands for '$p$ divides $q$'
$p|q\Leftrightarrow p=q$
$\Leftarrow$:
$p(1)=q$ and therefore $p|q$
$\Rightarrow$:
if $p=\pm 1$, $p|q\Rightarrow p=q$ does not hold:
all you need is one case to disprove an implication: $1|2 \rightarrow 1=2$, $-1|2 \rightarrow -1=2$ evaluate to $true\rightarrow false$, $true\rightarrow false$ which both evaluate to $false$.
in turn, $p|q\Leftrightarrow p=q$ does not hold for $p=\pm 1$
for $p\neq \pm 1$:
proof by contraposition: $[p|q\Rightarrow p=q]\Leftrightarrow [p\neq q\Rightarrow p\nmid q]$
$p\neq q\Rightarrow p\nmid q$:
$p\neq q$
$\therefore q=p+r(r$ an integer) $=p+p_1p_2...p_n;\space$ primes $ p_1,p_2,...p_n\neq p$; they cannot equal $p$ because then the prime $q$ would be divisible by something other than itself and $1$, namely $p$.
$\therefore p\nmid q$
Please verify proof.
$(\Leftarrow)$ looks good.
For $(\Rightarrow)$ I would say:
If $p\mid q$ then as $q$ is a prime, $p=\pm1$ or $p=\pm q$ but $p$ is a prime so $p=q$.
I am using: If $q>1$ then $q$ is a prime if and only if the following is true: $d\mid q$ implies $d=\pm1$ or $d=\pm q$.