While trying to prove that $\sqrt{3}$ is irrational, I had to use the assumption that if $n^2$ is divisible by 3, then so is $n$.
Mathematically, I am trying to prove that if $n^2=3q$, then $n=3p$ for some $n,p,q\in\mathbb{N}$.
I came up with a proof by contradiction but I am not sure if it's logically correct.
Let $n,p,q,\in\mathbb{N}$ and let $n^2=3p$. Thus, $n^2$ is divisible by 3. Now assume that $n$ is not divisible by $3$, or $n\neq 3q$.
We have that $$n=\sqrt{3}\sqrt{p}\neq 3q$$ This means that $$p\neq 3q^2$$ At this point, can I say that I have reached a contradiction because $p=12\in\mathbb{N}$ and $q=2\in\mathbb{N}$ provide a counter-example to the last statement?
EDIT: I am looking for an elementary proof that does not use Euclid's lemma.
Assume n is not divisible by 3, then n is the product of primes and powers of primes, none of which is 3. $n^2$ is the product of the same set of primes and powers, with each exponent multiplied by 2. However 3 is still not on the list, so it does not divide $n^2$.