Here is what you can prove : if $\lim_{x \to a^+} |f(x)| \to \infty$, then either $f(x) \to \infty$ or $f(x) \to -\infty$. The reason is simple ; for every $M > 0$, there exists $\delta > 0$ such that if $0 < x-a < \delta$, $|f(x)| > M$. If in this interval we have $x_1$ and $x_2$ such that $f(x_1) > M > -M > f(x_2)$, then by the intermediate value theorem there would exists $x$ between $x_1$ and $x_2$ with $f(x) = 0$, contradicting $f(x) > M$ because since $x$ is between $x_1$ and $x_2$, it also satisfies $0 < x-a < \delta$.
In a similar manner you can show that if $\lim_{x \to a^-} |f(x)| \to \infty$, then $f(x) \to \infty$ or $f(x) \to -\infty$.
Now when $x \to a$, then "when $x$ comes from the left side" you only have one possibility, $+$ or $-$ infinity, and the same goes if $x$ "comes from the right side". Therefore the example $f(x) = \frac 1x$ can arise.
However, this is because the real line minus the point $a$ is not a connected domain. In other words, the question becomes true if $f : \Bbb R^n \to \Bbb R$ with $n > 1$. Now why is that?
If $f$ is continuous and $\lim_{x \to a} |f(x)| = \infty$, then for all $M > 0$, there exists $\delta > 0$ such that $0 < |x-a| < \delta$ in $\Bbb R^n$ implies $|f(x)| > M$. Since the open punctured ball $0 < |x-a| < \delta$ is connected by arcs, suppose $f(x_1) > M > -M > f(x_2)$. Then there exists an arc completely contained in the punctured ball, and since $f$ is continuous, you can use the intermediate value theorem to derive a contradiction. Therefore $f$ cannot change sign on that punctured ball, hence either $f(x) \to \infty$ or $f(x) \to -\infty$.
Hope that helps,