Without having amsmath loaded, the following code manages to draw an fbox around the equation numbers if they have been referenced. However, this does not work together with amsmath and should be altered to make use of mathtools, which could be used more easily, but at the moment I have no idea how to switch the style back after printing out the eq. number.
\makeatletter
% overwrite the reference mechanism: ref shall also create a label where a label has first been referenced. The next time LaTeX is run, \label will recognized that the created eq. number is referenced later on and make it being formatted accordingly. A macro is defined so that no multiple labels for referenced to the same eq. label are defined.
\let\old@ref\ref
\def\ref#1{%
\write\@auxout{%
\string\used@label{#1}%
}%
\old@ref{#1}%
}
% overwrite the label mechanism: if a label has been created by a former run of LaTeX that indicates that there has been made use of the actual label ought to be created, the next print of the eq. number via \@eqnum is redirected to a new command
\let\old@label\label
\def\label#1{%
\@ifundefined{used@label@#1}%
{}%
{\let\@eqnnum\new@eqnum}%
\old@label{#1}
}
% overwrite the equation number mechanism: the new@eqnum prints the equation number in another style and then switches back to the default style.
\let\old@eqnnum\@eqnnum
\def\new@eqnum{%
\refeqnum%
\let\@eqnnum\old@eqnum%
}
% this macro marks the label given as used in the aux file.
\def\used@label#1{%
\@ifundefined{used@label@#1}{%
\expandafter\gdef\csname used@label@#1\endcsname{}%
}%
{}%
}
\makeatother
% this macro holds the \theequation-definition for referenced equations.
\def\refeqnum{\fbox{\theequation}}