Step 1: Look at what each term of the formula measures.
$\chi^2=\sum\dfrac{(O-E)^2}{E}$ adds up squared gaps between observed and expected counts, each divided by a positive expected count.
Step 2: See what happens when there is no gap.
If every observed frequency equals its expected frequency, then $O-E=0$ for every class, so every squared term $(O-E)^2$ is zero.
Step 3: Add up the zero terms.
A sum made up entirely of zero terms is itself zero, no matter how many categories there are.
\[ \boxed{\chi^2=0} \]