We show that necessity as in the modal logic \(\mathsf{S5}\) or in Leibniz's interpretation is not a truth function. This is Exercise 1.5.1 of Fitting and Mendelsohn's First-Order Modal Logic.
Suppose necessity is a truth function. Write "\(P\) is necessary" as \(\Box P\). We consider two requirements on necessity:
There are four single input truth functions: functions from \(\{\mathtt{True},\mathtt{False}\}\) to \(\{\mathtt{True},\mathtt{False}\}\). Only one of them is such that \(\Box P\to P\) holds and \(P\to \Box P\) is false. The function is:
Now, if necessity is a truth function, it must be this function. So \(\neg\Box P\) is true for any \(P\). That is, nothing is necessary. This is not a good requirement for necessity.