Why doesn’t my simple the_title filter get applied?

Try changing this:

add_filter( ‘the_title’, ‘myfunction’);

to this:

add_filter( 'the_title', 'myfunction' );

(If this is indeed your problem it is likely an issue of copy/pasting code from a tutorial with curly quotes in place of standard single-quote marks.)

p.s. prefix your function name with your Plugin slug. “myfunction” is far too generic.