either use global variable
in functions.php:
global $prevPost;
$prevPost = 10;
in single.php :
global $prevPost;
if($prevPost)
.. . . . Your code continues. .
Second method: define a function in functions.php and call that in single.php
in functions.php :
function func_prevPost(){
$prevPost = 10;
return $prevPost;
}
in single.php :
if(func_prevPost()){
// your code here
}