I have a function that I want to study it's asymptotic behavior.
The function is
$$ f(k) = - \frac{k^2}{4} - \frac{\log\pi}{2} + \log\left( \frac12 \left| \mathrm{Erfi}(\frac{k}{2} - \pi i) - \mathrm{Erfi}(\frac{k}{2} + \pi i)\right|\right) $$
and k takes only positive integer.
The plot of this function looks like:
ListPlot[Table[f[k], {k, 0, 100}], PlotRange -> All]

It looks like that the function has a asymptotic behavior (looks like ~ Log[k]), could we find a way to extract the main term (the coefficient of the Log[k] if behave like log)?
From here and here, I find the mainTerm function, but it seems to have ignored the big Log term and not work in this case:
mainTerm[f[k], k]
(* -(k^2/4) *)
This is more of a Mathematica answer than a Mathematics answer. As george indicated we can write
$$ f(k) = \frac{1}{4}\log\left\{ \frac{\exp(-k^2)}{(2\pi)^2} \operatorname{Re}\left[\operatorname{erf}\left(\frac{ik}{2}-\pi\right)\right]^4\right\} + \frac{\log 2}{2}. $$
(Note the constant term $\log 2/2$ which was missing from george's answer.) The question really comes down to estimating $\operatorname{Re}\left[\operatorname{erf}\left(\frac{ik}{2}-\pi\right)\right]$ as $k \to \infty$.
In Mathematica we enter
which yields
$$ i^{2 \text{Floor}\left[\frac{\text{Arg}\left[-i k \pi +\pi ^2\right]}{2 \pi }\right]}+e^{\frac{k^2}{4}+i k \pi } \left(\frac{2 i e^{-\pi ^2}}{\sqrt{\pi } k}+\frac{4 e^{-\pi ^2} \sqrt{\pi }}{k^2}+O\left[\frac{1}{k}\right]^3\right). $$
The reason we expand to second order is that we know $k$ will be an integer and hence $e^{ik\pi} = \pm 1$. So, when we take the real part, the first term in the parentheses, being purely imaginary, will disappear.
We continue with
which yields
$$ \frac{4 e^{\frac{k^2}{4}-\pi ^2} \sqrt{\pi } \text{Cos}[k \pi ]}{k^2}+\text{Cos}\left[\pi \text{Floor}\left[\frac{\text{Arg}\left[-i k \pi +\pi ^2\right]}{2 \pi }\right]\right]-\frac{2 e^{\frac{k^2}{4}-\pi ^2} \text{Sin}[k \pi ]}{k \sqrt{\pi }}. $$
Now the second term is $O(1)$ which is much smaller than the first term and the third term is zero since $\sin(k\pi) = 0$, so to find the leading order we'll just take the first term.
The argument in the $\log$ term in $f$ is then, to first order,
$$ \frac{64 e^{-4 \pi ^2} \text{Cos}[k \pi ]^4}{k^8}. $$
Of course $\cos(k\pi)^4 = 1$ so we conclude that
$$ f(k) \approx \frac{1}{4} \log\left(\frac{64 e^{-4 \pi ^2}}{k^8}\right) + \frac{\log 2}{2}. $$
To simplify this a little we could use
to get
$$ f(k) \approx -2\log k - \pi^2 + \log 4. $$
Here's a plot of this approximation in red versus the numerical points in blue.