Subsampling of Frequent Words in Word2Vec
My guess is that we should regard $f(w_i)$ as a number between 0 and 1, i.e., the number of times word $w_i$ appears divided by the number of words.  This makes it an estimate of the probability of occurrence of word $w_i$.

Then the formula seems to lead to reasonable results.  If you have a very frequent word (appears as a $10^{-3}$ fraction of the words), we have $P(w_i) = 1 - \sqrt{10^{-2}} = 0.9$, so it's very likely to be discarded.  If you have a moderately infrequent word (probability of occurrence $10^{-5}$), then we have $P(w_i) = 1 - \sqrt{1} = 0$, so it won't be discarded.  If you have a word that is even rare than that, it won't be discarded either.  So this discards very frequent words with high probability and keeps almost all words that are rare or moderately rare.