Is it possible to do modulo of a fraction I am trying to figure out how to take the modulo of a fraction. 

For example:  1/2 mod 3.  

When I type it in google calculator I get 1/2. Can anyone explain to me how to do the calculation?
One can perform arithmetic of fractions mod $\,m\,$ as long as all fractions $\,a/b\,$  have denominator $\,b\,$ coprime to $\,m,\,$ since then, by Bezout, $\,b\,$ is invertible mod $\,m\,$ so the fraction has the unique denotation $\,x = a/b = ab^{-1}$ (the unique solution of $\,bx = a).\,$  The usual rules of fraction arithmetic remain true (as long as one restricts to such fractions), e.g. from a prior answer:

Hint $\,\ {\rm  mod}\ 13\!:\  \dfrac{41}7 \equiv  \dfrac{28}7 \equiv 4\ \ $ by $\ \ 41\equiv 41\!-\!13 \equiv 28$

Alternatively $\,\ \dfrac{41}{7}\equiv\dfrac{(-2)(-1)}{-6}\equiv \dfrac{-2}{-2}\dfrac{12}3\equiv 4\ \ $ by $\ \ \begin{eqnarray}41&amp;&amp;\!\!\equiv\ \ 2\\ 7 &amp;&amp;\!\!\equiv -6\end{eqnarray}$

Alternatively $\,\ \dfrac{41}{7}\equiv \dfrac{2}7\equiv \dfrac{4}{14}\equiv \dfrac{4}1\ $ by Gauss's Algorithm.

Such twiddling (adding/subtracting the modulus from numerator or denominator till things divide or factor nicely) works quite well for small numbers. For larger numbers one can invert the denominator by the Extended Euclidean Algorithm, or Gauss's algorithm if the modulus is prime.

Beware $\ $ The use of fractions in modular arithmetic is valid only when the denominator is invertible, i.e. coprime to the modulus. Otherwise the quotient need not be unique, for example mod $\rm\:10,\:$ $\rm\:4\,x\equiv 2\:$ has solutions $\rm\:x\equiv 3,8,\:$ so the "fraction" $\rm\:x \equiv 2/4\pmod{10}\,$ cannot designate a unique solution of $\,4x\equiv 2.\,$ Indeed, the solution is $\rm\:x\equiv 1/2\equiv 3\pmod 5,\,$ which requires canceling $\,2\,$ from the modulus too, since $\rm\:10\:|\:4x-2\iff5\:|\:2x-1.\:$

Generally the grade-school rules of fraction arithmetic apply universally (i.e. in all rings) where the denominators are invertible. This fundamental property will be clarified conceptually when one learns in university algebra about the universal properties of fractions rings and localizations.
Finding the inverse of p^n mod q where p,q are relatively-prime primes using Fermat’s little equation,
p^(-n) mod q = p^x mod q where x = (-n) mod (q-1).
For example, 3^(-1) mod 5 = 3^[(5-1)-1] mod 5 = 3^3 mod 5 = 2.
Another example, 7^(-1) mod 13 = 7^11 mod 13 = 2 (done by calculator).
The formula is useful when one is working algebraically, rather than with specific numbers.