You did: $\,{\rm mod}\ 5\!:\ x\equiv 0,\pm1,\pm2\,\Rightarrow\, x^2\equiv 0,\pm1\not\equiv 2,\,$ a modular brute-force case analysis.
Without brute force: $\,{\rm mod}\ 5\!:\,\ 2\equiv x^2\,\overset{\rm square}\Longrightarrow\, 4\equiv x^4\overset{\rm Fermat}\equiv 1,\,$ contradiction.
Remark $ $ The latter generalizes: it is the easy necessary direction of Euler's Criterion, which we summarize below, highlighting the analogy between the simpler additive and multiplicative forms (in particular the analogy $\, \color{#c00}n\cdot x\, \leftrightarrow\, x^\color{#c00}n$ between $\color{#c00}n$'th multiples and $\color{#c00}n$'th powers).
$$\begin{align}&\bmod \color{#0a0}k\:\!\color{#c00}n\!:\qquad\ \ \,\overbrace{\exists\, a\!:\ x \equiv \color{#c00}na}^{\large x\:\!\ \text{an $\color{#c00}n$'th multiple}}\!\!\! \Rightarrow\, \color{#0a0}kx\equiv 0\ \ \,[\:\!{\rm by}\ \ kx \equiv kna \equiv 0\cdot a \equiv 0\:\!]\\[.3em]
&\bmod p\!=\!\color{#0a0}k\color{#c00}n\!+\!1\!:\, \underbrace{\exists\, a\!:\ x \equiv a^{\large \color{#c00}n}}_{\large x\:\!\ \text{an $\color{#c00}n$'th power}} \Rightarrow\, x^{\large\color{#0a0} k} \equiv 1\ \ [\:\!{\rm by}\ \ x^{\large k} \equiv\, a^{\large nk}\! \equiv \underbrace{a^{\large p-1}\! \equiv 1}_{\rm Fermat},\ {\rm by}\,\ x\not\equiv 0\:\!] \\[.6em]
{\rm e.g.}\ \ &\bmod \color{#0a0}2\cdot \color{#c00}5\!:\quad\:\!\ \ x\,\text{ a $\,\color{#c00}5$'th mult.}\:\!\ \Rightarrow\, \color{#0a0}2x\equiv 0\\[.3em]
&\bmod \color{#0a0}2\cdot\color{#c00}5\!+\!1\!:\ x\,\text{ a $\,\color{#c00}{5}$'th power}\Rightarrow\, x^{\large \color{#0a0}2}\!\equiv 1,\ {\rm by}\,\ x\not\equiv 0\end{align}
$$
This analogy will become much clearer upon study of the (simple) structure of cyclic groups.