The original question is answered by Lucia. I was thinking on, what if $k$ depends on $n$? I'm interested on question whether $k = \frac{\log n}{\log\log n}$.
In related question (Consecutive non squarefree integers) we have seen that $f\left(\frac{\log n}{\log\log n},n\right) > 0$ infinitely often.
Now I prove that, for any $\varepsilon$
$$f\left(\frac{\log n}{\log\log n}, n\right) \geq n^{\frac{1}{2}- \varepsilon}$$
infinitely often.
For some $k$ and for some $\pi$ permutation of $\{k+1, k+2, \ldots ,p_k^2\}$ let the following congruence system:
$$
\begin{array}{ccll}
x_{\pi}& \equiv & k& \mod{p_k^2} \\
x_{\pi}& \equiv & k+1& \mod{p_{\pi(k+1)}^2} \\
& \colon & & \\
x_{\pi}& \equiv & p_k^2& \mod{p_{\pi(p_k^2)}^2}
\end{array}
$$
The system for any $\pi$ has a solution $x_{\pi}$ smaller than $\Pi_{i=k}^{p_k^2} p_i^2$, and $\{x_{\pi}-k, \ldots, x_{\pi}-p_k^2\}$ can not contain square-free numbers.
If $\pi_1 \neq \pi_2$, then the difference between $x_{\pi_1}$ and $x_{\pi_2}$ is at least $p_k^2-k$, because in $\{x_{\pi}-k, \ldots, x_{\pi}-p_k^2\}$ exactly one integer is divisible by $p_i^2$ for $k\leq i \leq p_k^2$, and only $x_{\pi}-k$ is divisible by $p_k^2$, so the intervals $[x_{\pi_1}-p_k^2, x_{\pi_1}-k]$ and $[x_{\pi_2}-p_k^2, x_{\pi_2}-k]$ are not overlapping. From that, there are at least $(p_k^2-k-1)!$ disjoint intervals of size $p_k^2-k$.
So let $m = p_k^2 \sim k^2\log^2k$, there are $(m-o(m^{1/2}))!$ disjoint intervals of size $m-o(m^{1/2})$ which doesn't contain square-free integers until $\Pi_{i=1}^{m} p_i^2 \leq e^{2(1+\varepsilon)m\log m}$. By letting $m = \frac{\log n}{\log\log n}$, the Stirling formula gives the solution.
Remarks: With more carefully written the congruence system, the same holds for $\frac{\pi^2}{6}\frac{\log n}{\log\log n}$. I think this also motivate that, $\frac{\pi^2}{6}\frac{\log n}{\log\log n}$ is not the best lower bound, but the fact $f\left((1+\varepsilon)\frac{\pi^2}{6}\frac{\log n}{\log\log n},n\right) > 0$ happens infinitely often, is not known.