Calculate the p-adic norm of a rational number
Julia, 94 80 75 bytes

f(m,n,p)=(k=gcd(m,n)
g(m)=m%p&gt;0?g(m÷p)p:1
m!=0?print(g(n÷k),/,g(m÷k)):0)


Note: using linefeeds in place of semicolons for readability - will work same either way.

This is quite simple - the g(m,n) function uses recursion and remainder (%) to extract the p^n factor from input m, with n=1 as default and then multiplied by p on each step of the recursion, so that the output will be p^n. The code applies that to n/gcd(m,n), and then to m/gcd(m,n) to obtain the appropriate expression. k=gcd(m,n) is used to avoid calculating the gcd(m,n) twice, to save characters. m!=0 is a test to handle the case where x=0.

The output is of the form N/1 or 1/N as appropriate, where N is p^e.