Too bad I can't use \equiv on begin{align*} enviorments.
Let $f(x)$ equal units digit of $x.$
$f(3^1) = 3$
$f(3^2) = 9 $
\(\begin{align*} f(3^3) &= 27 \pmod{10} \\ &= 7 \pmod{10} \\ &= 7 \end{align*}\)
\(\begin{align*} f(3^4) &= 81 \pmod{10} \\ &= 1 \pmod{10} \\ &= 1 \end{align*}\)
\(\begin{align*} f(3^5) &= 243 \pmod{10} \\ &= 3 \pmod{10} \\ &= 3 \end{align*}\)
Thus, given $3^n,$
$n \equiv 0 \pmod 4, f(n) = 1$
$n \equiv 1 \pmod 4, f(n) = 3$
$n \equiv 2 \pmod 4, f(n) = 9$
$n \equiv 3 \pmod 4, f(n) = 7$
$123 \equiv 3 \pmod 4, $ so $f(n) = \boxed{7}$
.