Use glGetIntegerv(GL_CONTEXT_PROFILE_MASK,...) in OpenGL 3.2 or above to query this. GL_CONTEXT_FLAGS might also be useful too if you want to check whether debug/forward-compatible/robust/... flags are set.

Try to do something that's not supported in a core context. Depending on your driver this may be as simple as a glBegin/glEnd call, followed by a glGetError. Or you might try a draw call with VAO 0 - you should get GL_INVALID_OPERATION on a core context.