$Ax=b$ has a solution over finite field $\mathbb{F}_p$ then does it also have a solution over real numbers 
Let A be an $m\times n$ matrix and b an $m\times 1$ vector, both with integer entries. (a) Suppose that there exists a prime number p such that equation Ax=b seen as an equation over finite field $\mathbb{F}_p$ has a solution. Then does there exist a solution to Ax=b over the real numbers?

(b) If $Ax=b$ has a solution over $\mathbb{F}_p$ for every prime p, is a real solution guaranteed?
This question was asked in previous year exam of my institute and I was unable to solve it and need help.
I am really confused on what result exactly needs to be used because I am unable to relate the solutions in field $\mathbb{F}_p$ to the field of real numbers and would like to have some hints.
Thanks!
 A: Here's an nice approach.  Some call this a warmup to weak nullstellansatz.  Working over some field $\mathbb K$
Lemma:
$A\mathbf x = \mathbf b$
has no solution iff there is some $\mathbf y^T A = \mathbf 0^T$ but $\mathbf y^T\mathbf b=1$.  What this says is the only obstacle to a solution is the obvious one, i.e. if there was both a solution and such a $\mathbf y$ we'd conclude $0=1$.
This has been asked elsewhere on the site; I suggest proving it via use of Rank Normal Form.
Main Problem:
you have integer matrix $A$ and integer coordinate vector $\mathbf b$ and you want to view them over two different fields, $\mathbb Q$ and $\mathbb F_p$ for some well chosen prime.
over $\mathbb Q$
Suppose there is no solution.  By application of the Lemma there exists some $\mathbf y \in \mathbb Q^m$ such that $\mathbf y^TA=\mathbf 0^T$ and $\mathbf y^T \mathbf b = 1$.  Via re-scaling (i.e. clearing denominators) we have integer valued $\mathbf y$ such that $\mathbf y^T A = \mathbf 0$ and $\mathbf y^T\mathbf b = \alpha  \in \mathbb Z_{\gt 0}$.
Being a positive integer, $\alpha$ is a product of finitely many primes but there exist infinitely many primes. So select e.g. some prime $p^*\gt \alpha$.
Applying modulo $p^*$ to all entries gives us
(note: what we are really doing is a ring homomorphism  $\mathbb Z\longrightarrow \mathbb Z_{p^*} \cong \mathbb F_{p^*}$)
over $\mathbb F_{p^*}$
$\mathbf y^TA =\mathbf 0^T$ and $\mathbf y^T\mathbf b =\alpha \% p^* \neq 0$
but by application of the Lemma, this contradicts the fact that
$A\mathbf x = \mathbf b$ has a solution.
(This is the easy direction of the lemma: plugging in our $\mathbf y$ and using associativity we have $0=\alpha \neq 0$ which is a contradiction.)  Hence there must be a solution over $\mathbb Q$.
A: Some of this is redundant in light of the comments on your question, but here are some hints.
For part a, the answer is no.
For part b, the answer is yes. To prove that this is the case, it helps to use the following facts.

*

*The system $Ax = b$ has a solution iff the matrix $A$ and the augmented matrix $[A\mid b]$ have the same rank.

*A matrix $M$ has rank at least $r$ if and only if $M$ has an $r \times r$ submatrix with non-zero determinant.

