Your question is a little vague...
In what way do you want/expect your Mac Mini to 'work' with your Mountain Lion-based iMac?
If you're asking if you can hook them altogether and each machine see the others on the network, sure.
Both the iMac and the Mini will be able to share the connection through the Airport Extreme.
What more are you hoping for?
If you buy the Mac Mini and connect it to your network, your iMac will have exactly the same configuration it always had. It's completely unrelated to whatever other devices are on the network.
Memory isn't (and can't) be shared across devices, so no amount of memory in the Mac Mini (or any other machine) is going to make a difference.
Some resources can be shared - for example, you can setup file sharing on the Mac Mini so that the iMac can access disks attached to the server, but it doesn't work that way with RAM.