It is mandatory by law, yes, but if you don't have shakai hoken (which automatically puts you on a pension plan), then you have to sign up for it (nenkin) separately along with your health insurance (kokumin kenko hoken). Ward office will only tell you you have to do this; they will not slam your face to the floor, put you in a hammerlock, and force you to do it.