High density foam or any other foam can be easily cut with an electric kitchen knife.
Or you can use a hot knife as well to cut the high density foam with.
To cut a foam mattress at home you can use an electric knife or even a hot knife.
The Hot Knife will slice through the foam mattress easier and faster but will emit a smell when the foam is being cut.
I have used an electric kitchen carving knife to cut foam mattresses and foam at home and it worked great although you can also use a regular hand saw such as a hack saw and slowly saw through the foam mattress.
But the heated knife or the electric carving knife will work much better and much faster.
Harbor freight sells a hot knife for cutting styrofoam which also works great for cutting foam mattresses and other upholstery foam.
The heated knife will work great but you just have to be aware that there will be some smell and possibly smoke to it.
So try to have ventilation when using the heated knife to cut the foam mattress.