This type of fossil is called a mold. A cast fossil forms when a mold fossil is filled with some form of mineral, usually through the seepage of water depositing the minerals within the mold. In time, the mold is filled and the materials deposited harden, creating a replica of the original fossil.
Hope this helps you :p