Prove that if x's square is divisible by a, then x is also divisible by a

How would you prove that, if $\displaystyle x^2$ is divisible by $\displaystyle a$ (where $\displaystyle a$ is prime and $\displaystyle x$ is an integer), then $\displaystyle x$ is also divisible by $\displaystyle a$?

For example, if $\displaystyle a=3$, then how do you prove that

**if** $\displaystyle x^2$ is divisible by $\displaystyle 3$,

**then** $\displaystyle x$ is also divisible by $\displaystyle 3$?

I get the feeling this might be blindingly obvious, but then, those are the types of proofs I tend to have trouble on. I know the reason for it intuitively (it has to do with $\displaystyle a$ being prime), but somehow i dont know how to demonstrate it. I guess I would start by saying that

$\displaystyle x^2=am$

with $\displaystyle m$ being an integer. So then I would want to prove that, if this is true, then

$\displaystyle x=an$

is true also ($\displaystyle n$ being an integer). Is that right? Where would I go from there? A proof by contradiction? I'm still not totally fluent in abstract language, so it takes me a long time to "translate" things.

Thanks!