You're trying to replace a string. Pass the jQuery object instead:
jQuery(document).ready(function($) {
$('.delete_pdf').each(function(i,e) { //grab the link class delete-pdf
var id = $(this).attr('id').replace(/delete-/, '');
var li = $(this).closest('li');
$(this).click(function(){
//alert('Clicked! '+ id);//$(this).attr('id')); //THIS WORKS WHEN CLICKED
//alert(li);
$(li).replaceWith('<input type="file" style="width: 700px;" name="' + id + '" id="' + id + '" />');
});
});