[ -f .ssh/id_rsa -a -f .ssh/id_rsa.pub ] && echo both || echo not
or
[[ -f .ssh/id_rsa && -f .ssh/id_rsa.pub ]] && echo both || echo not
also, if you for the [[ ]]
solution, you'll probably want to change #!/bin/sh
to #!/bin/bash
in compliance with your question's tag.