You would have to pass an actual function to setInterval() like this:
f = 1
$(".thumb").hover(function() {
var self = $(this);
intervalId = setInterval(function() {self.text(f++)}, 400));
});
What you are doing in your original code is passing the result of calling $(this).text(f++) which executes immediately to setInterval(). Since that doesn't return a function, there is no callback function for setInterval() so nothing runs on the interval.
If you also want to stop the interval when you stop hovering, then you could do this:
var f = 1;
var intervalId;
$(".thumb").hover(function() {
var self = $(this);
if (intervalId) {
clearInterval(intervalId);
}
intervalId = setInterval(function() {self.text(f++)}, 400));
}, function() {
f = 1;
clearInterval(intervalId);
intervalId = null;
});