How can my private key be revealed if I use the same nonce while generating the signature? I know it is well understood that it is not a good practice to use the same nonce while generating the signatures, but I am not getting the math right. 

Assume I have some UTXOs that are controlled by my private key Q. Say I have spent two of the UTXOs using nonce 'N' to generate my signature. Now the (R,S) components of the signature are public and the transactions are public so everyone has access to them. 

S1 = N^(-1)*[hash(m1) + Q*R] mod p


S2 = N^(-1)*[hash(m2) + Q*R] mod p

S1 - S2 = N^(-1)*[hash(m1) - hash(m2)] mod p


Even though we know S1, S2, m1 and m2, isn't solving for N^(-1), and hence N, becomes equivalent to finding the solution to the discrete logarithm?
Let me rewrite your question in a different notation, where all lowercase values are integers and uppercase values are points.


The group generator is G (a known constant).
The private key is q, its corresponding public key is Q = qG.
The nonce is n, its corresponding point is R = nG.
The X coordinate of R is r.
The hash function is h(x).
A signature is (r,s), where s is computed as n-1(h(m) + qr).
A signature is valid iff r = x(s-1(h(m)G + rQ)) (where x() stands for "The X coordinate of point ...")


Now for the two signatures it holds that:


s1 = n-1(h(m1) + qr)
s2 = n-1(h(m2) + qr)
s1 - s2 = n-1(h(m1) - h(m2))
n = (s1 - s2)-1(h(m1) - h(m2))


As s1 and s2 are just integers, (s1 - s2)-1 can be trivially computed using a modular inverse; there are no elliptic curve points involved here (over which this problem would be hard).

Once you know n, you can find q by rewriting the first equation:


ns1 = h(m1) + qr
ns1 - h(m1) = qr
q = r-1(ns1 - h(m1))


Substituting this in the earlier equations gives you:


q = (r (s1 - s2))-1(m1s2 - m2s1)