/say command (how to name the command block)
If you want to make the command block say a command as if the closest player is saying it, you should use the /execute
command.
It's really simple. What the command does is that it executes the command on behalf of an entity. The specific command you're looking for looks like this:
/execute @p ~ ~ ~ say <message>
If the nearest player's name is Dragonmaster, and the message you want to say is "Hello, world!", then the chat message will look like this:
[Dragonmaster] Hello, world!