This is a coat rack peg that fits into a hole. The base is flared to allow it to be wedged into the hole, and the end of the peg is a ball to keep items from slipping off.
The base also has a hole that can accept a screw if you want to attach it that way.
See http://www.chrisfinke.com/2016/02/17/3d-printed-coat-rack-peg/