Minimax theorems for functions involving a real variable and applications